webstik/ yii2-telegram-notifications
这是为Telegram Notifications开发的扩展
1.0.0
2018-04-20 13:24 UTC
Requires
- php: >=5.4.0
- longman/telegram-bot: *
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-08-29 05:11:59 UTC
README
这是用于Telegram通知的扩展
为yii2 advanced模板提供的文档
安装
安装此扩展的首选方式是通过composer。
运行以下命令之一
php composer.phar require --prefer-dist webstik/yii2-telegram-notifications:dev-master
或
"webstik/yii2-telegram-notifications": "dev-master"
将其添加到你的composer.json
文件的require部分。
使用方法
###模块此扩展实现了使用Telegram WebHooks。为了处理请求,您必须在后端配置名为telegramNotifications
的模块,如下所示
###迁移此扩展使用数据库保存Telegram机器人的配置。您必须在console/main.php
文件中添加以下迁移配置,然后运行控制台命令
'modules' => [ 'telegramNotifications' => [ 'class' => '\webstik\telegramNotifications\Module' ] ],
###UI配置完成后,您可以使用网页来设置webhooks、token和pin-code。请点击以下链接
'controllerMap' => [ 'migrate-webstik-telegram' => [ 'class' => 'yii\console\controllers\MigrateController', 'migrationTable' => 'migration_webstik_telega', 'migrationPath' => '@webstik/telegramNotifications/migrations', ], ],
/index.php?r=<moduleName>/telegram-setting
php yii migrate-webstik-telegram
或
/index.php?r=telegramNotifications/telegram-setting
或
/telegramNotifications/telegram-setting
或
/telegramNotifications/telegram-setting
###已订阅用户列表已订阅用户的列表可通过以下链接获得
/telegramNotifications/telegram-users