mamadali/yii2-bale-bot

Bale bot

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

v1.0 2022-01-12 18:35 UTC

This package is auto-updated.

Last update: 2024-12-13 02:01:44 UTC


README

Bale bot api docs

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mamadali/yii2-bale-bot "*"

or add

"mamadali/yii2-bale-bot": "*"

to the require section of your composer.json file.

Usage

First create your bot in @botfateher in bale messanger and get bot token

Then add this code to components section of config.php or if use advanced project common/config/main.php

    'components' => [
        ...
        'bale' => [
            'class' => 'mamadali\bale\Bale',
            'botToken' => '<Enter your bot token here>',
        ],
        ...
    ];

Once the extension is installed, simply use it in your code by :

<?= Yii::$app->bale->sendMessage([
        'chat_id' => '<Enter chat id here>',
        'text' => 'test',
    ]); ?>

Usable methods list

sendMessage
sendPhoto
sendAudio
sendDocument
sendVideo