deepeloper/tunneled-webhooks
最新稳定版本:1.1.0
Composer 安装命令:
composer create-project deepeloper/tunneled-webhooks
包简介
Tunneled Webhooks
关键字:
README 文档
README
Runs tunneling service and registers temporary webhooks for workstation having no white IP by one command /path/to/php bin/run.php /path/to/config.php.
- Implemented tunneling services: ngrok;
- Implemented webhooks connectors: Telegram;
- Implemented bots: Windbag.
You can add your own tunneling services, register and handle your own webhooks.
Compatibility
Installation
composer require deepeloper/tunneled-webhooks
Tunneling services
Download ngrok (and/or other tunneling services), sign up in service, get auth token and run service once /path/to/ngrok authtoken %YOUR_NGROCK_AUTH_TOKEN%.
Webhooks
Register Telegram bot and receive bot auth token.
Configuring local web server
- nginx
Add *.ngrok.io subdomains:
server {
listen 127.0.0.1:80;
server_name ~^(.*)\.ngrok\.io;
; This application www-directory
root /path/to/www;
}
and restart nginx.
- Apache
According to ngrok docs in own config modify
«service/command» value as /path/to/ngrok http --host-header=%LOCAL_HOST_NAME% 80.
Application config
Copy «config.skeleton.php» to your own config file and put ngrok path & Telegram token to the new file:
// ... 'service' => [ 'class' => "\\deepeloper\\TunneledWebhooks\\Service\Ngrok", // CLI command to run service. // Modify path here: 'command' => "/path/to/ngrok http 80", // ... ], 'webhook' => [ 'Telegram' => [ 'Windbag' => [ // ... // Telegram bot token. // Modify token here: 'token' => "", // ...
Usage
Run tunneling service and bot
vendor/bin/tunneled-webhooks /path/to/config.php
Tunneling service will be started, Telegram webhook will be registered, and you could to start conversation with Telegram bot.
Run bot from CLI
vendor/bin/bot.windbag
统计信息
- 总下载量: 37
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-16