Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatbase client

Installation

The preferred way to install this extension is through composer.

Either run

composer require maxpl/chatbase-api

add custom repo:

"repositories": [ { "type": "vcs", "url": "git@github.com:Maxpl/chatbase-api.git" } ]


require package

"require": { "maxpl/chatbase-api": "*" }


First Step
----------

Create account or sign in https://chatbase.com

Add bot
----------

Add you bot and copy his key in config sections 

example:

```php
frontend/config/main.php

'components' => [
	'chatbase' => [
                'class'   => 'Maxpl\ChatbaseApi\ChatbaseClient',
		'api_key' => '0a3edfg345-d123-d56u-d34h-4564564560aa',
                'platform'=> 'telegram',
	]
],

Usage

//Send message from user
$chatbase = Yii::$app->chatbase->init()->send([
    'user_id' => $user_id,//required
    'command' => $command or $this->controller->id . '-' . $this->controller->action->id, //optional
    'message' => $message,//required
]);
//Send message from bot to user
$chatbase = Yii::$app->chatbase->init()->send([
    'type' => 'agent',
    'user_id' => $user_id,//required
    'message' => $message,//required
]);

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages