mollsoft/web-telegram-bot
最新稳定版本:v1.0.8
Composer 安装命令:
composer require mollsoft/web-telegram-bot
包简介
Create Telegram Bots in Laravel similar to creating a website.
README 文档
README
Web Telegram Bot is a Laravel package for create Telegram Bots like Websites. Internal routing, sessions, forms, templates, layouts.
This module allows you to create Telegram bots using Laravel and Telegraph package similar to creating a website.
You can contact me for help.
Installation
You can install the package via composer:
composer require mollsoft/web-telegram-bot php artisan web-telegram-bot:install php artisan migrate
In file app/Providers/RouteServiceProvider.php add lines in $this->routes(function () {:
if( is_file(base_path('routes/telegraph.php')) ) { Route::middleware('telegraph') ->name('telegraph.') ->prefix('telegraph') ->group(base_path('routes/telegraph.php')); }
After you need create Telegram Bot using Telegraph instruction.
Commands
Add Telegram Bot
php artisan telegraph:new-bot
Manual polling updates from Telegram Bot:
php artisan telegraph:polling BOT_ID --debug
Manual live updates from Telegram Bot:
php artisan telegraph:live --debug
Views examples
<message> <video src="{{ resource_path("media/logo.mp4") }}" /> <reply-keyboard> <row> <columm>Menu 1</columm> <column>Menu 2</column> </row> <row> <columm>Menu 3</columm> <column>Menu 4</column> </row> </reply-keyboard> </message> <message> <p>Hello! Choice you language</p> <keyboard> <row> <column> <button value="language:en">English</button> </column> </row> <row> <column> <button value="language:ru">Russian</button> </column> </row> <row> <column> <a href="{{ route('contacts') }}">Support</a> </column> </row> </keyboard> </message>
How make 404 page?
Create file resources/views/telegraph/errors/404.blade.php.
Autoclear dialog
If you want to create a message that will not be permanently deleted, use the
tag instead of the tagExample:
<main> <video src="{{ resource_path("media/logo.mp4") }}" /> <reply-keyboard> <row> <columm>Menu 1</columm> <column>Menu 2</column> </row> <row> <columm>Menu 3</columm> <column>Menu 4</column> </row> </reply-keyboard> </main>
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-03