Download the PHP package davtur19/turibot without Composer
On this page you can find all versions of the php package davtur19/turibot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davtur19/turibot
More information about davtur19/turibot
Files in davtur19/turibot
Package turibot
Short Description A simple way to communicate with Telegram APIs in PHP.
License AGPL-3.0-or-later
Informations about the package turibot
TuriBot
TuriBot is a simple way to communicate with Telegram APIs in PHP
Requirements
Stable
PHP 8.0 or higher with curl extension
Beta (Async)
PHP 8.1 or higher, you need to install amp from composer
Installation
Stable
Beta (Async)
Webhook
Setup recommended: open setupWebhook.php in your browser and follow the setup wizard.
Manual setup: set webhook to the file webhook.php, and as parameter GET "api" set your token.
Example for manual setup:
Alternatively if you don't want to use GET, just change this piece of code.
GetUpdates
Usage
- Look at the examples (webhook.php and getUpdates.php), it's very simple if you know PHP and OOP
- All methods have the parameters in the same order as the BotAPIs
- The
reply_markup
,permissions
,commands
,entities
and parameters that require arrays, already have a json_encode in the functions, you just need to pass arrays
Security
https://github.com/php-telegram-bot/core/wiki/Securing-&-Hardening-your-Telegram-Bot
Custom endpoint
With the Bot API 5.0 it is now possible to self host your own Bot API, here is an example of how to add your own endpoint
Json payload
Only works with webhooks, for more info: https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates
I do not recommend using it as it may need a particular configuration to the webserver for flushing and you cannot get a response from the Bot API
Generator
https://github.com/davtur19/TuriBotGen
Contributors
Old version
I don't recommend its use, but it could be useful for those unfamiliar with OOP and would like to start learning how PHP and Telegram Bot Api work.
All versions of turibot with dependencies
php Version ^8.1
amphp/http-client Version ^v5.0@dev
amphp/file Version ^v3.0@dev