mirkhamidov / simple-bot-telegram
Telegram机器人
1.1
2021-03-24 21:25 UTC
This package is auto-updated.
Last update: 2024-08-25 05:52:36 UTC
README
安装
安装此扩展的首选方式是通过composer。
运行以下命令:
php composer.phar require mirkhamidov/simple-bot-telegram "*"
或者在您的composer.json
文件的require部分添加:
"mirkhamidov/simple-bot-telegram": "*"
用法
扩展安装后,只需在您的代码中使用即可:
<?php $tg = new TelegramBot($tokenForBot); $tg->sendMessage('Message with inline keyboard', $chatId, [ 'reply_markup' => json_encode([ 'inline_keyboard'=>[ [ ['text'=>"refresh",'callback_data'=> time()] ] ] ]); ?>
PS:受aki/yii2-bot-telegram启发