agtong / yii2-telegram-bot
Telegram bot for Yii 2
Installs: 136
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-httpclient: ~2.0.0
This package is auto-updated.
Last update: 2024-10-20 00:26:20 UTC
README
Yii2 Telegram bot.
Installation
The preferred way to install this extension is through composer.
Either run
composer require agtong/yii2-telegram-bot
or add
"agtong/yii2-telegram-bot": "*"
to the require section of your composer.json
file.
Usage
Use the below code to send a message.
$bot = new TelegramBot(['token' => '123456:abcde');
$bot->sendMessage('123456', 'Hello World!');
The sendMessage
function and it's optional paramters are shown below.
sendMessage($chat_id, $text, $parse_mode = null, $disable_web_page_preview = null, $disable_notification = null, $reply_to_message_id = null, $reply_markup = null)
Read more about the parameters here.