mirakhamidov / yii2-telegram-notifications
2.0.0
2022-09-08 17:31 UTC
Requires
- php: >=7.1.0
- yiisoft/yii2: >=2.0
README
安装
安装此扩展的首选方式是通过composer。
运行以下命令
composer require m1roff/yii2-telegram-notifications "dev-master"
配置
将这些行添加到您的项目配置文件中
'components' => [ ..., 'telegram' => [ 'class' => \m1roff\TelegramNotifications::class, 'token' => ***', // Token of your bot 'chat' => ***, // Notifications chat id 'extraTitle' => "⚠️⚠️⚠️ Some extra title added to message⚠️⚠️⚠️\n", // optional 'proxy' => 'socks5://LOGIN:PASS@PROXY_ADDRESS:PROXY_PORT', // optional, if needed to use proxy, like in Russia ], ],
如何使用
如何找到我的用户Id或聊天Id?
- 向机器人发送消息
- 查看最新的更新:
https://api.telegram.org/bot{BOT_TOKEN}/getUpdates
- {BOT_TOKEN} - 将其替换为您的机器人令牌