jambtc/yii2-telegram-notify
最新稳定版本:v0.1.0
Composer 安装命令:
composer require jambtc/yii2-telegram-notify
包简介
Yii2-oriented Telegram onboarding and notification toolkit
README 文档
README
Yii2-oriented Telegram onboarding and notification toolkit.
Install
composer require jambtc/yii2-telegram-notify:dev-main
Yii2 usage
Add component in config/web.php:
'components' => [ 'telegramNotify' => [ 'class' => Jambtc\Yii2TelegramNotify\YiiTelegramComponent::class, 'botToken' => env('TELEGRAM_BOT_TOKEN', ''), 'defaultChatId' => env('TELEGRAM_CHAT_ID', ''), ], ],
Send a message:
/** @var Jambtc\Yii2TelegramNotify\YiiTelegramComponent $tg */ $tg = Yii::$app->telegramNotify; $result = $tg->sendText('Hello from Yii2'); // ['ok' => bool, 'error' => string|null]
Verify bot and build onboarding link:
$verify = $tg->verifyBot(); $link = $tg->buildDeepLink('@mybot', 1, 'binance'); $chat = $tg->findChatForTokenHash($link['token_hash']);
Exposed classes
TelegramClientInterface,TelegramClientTelegramOnboardingInterface,TelegramOnboardingServiceTelegramNotifierInterface,TelegramNotifierYiiTelegramComponent
Test
composer install vendor/bin/phpunit
License
MIT
统计信息
- 总下载量: 612
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-05