Download the PHP package quiec/boting without Composer
On this page you can find all versions of the php package quiec/boting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package boting
Short Description Simple but powerful and Async(multi-thread) Telegram Bot library
License MIT
Informations about the package boting
Boting
Simple yet Powerful.
Boting, The best Telegram Bot library for fast and asynchronous bot with PHP.
Features
- %100 Async (😳)
- Always compatible with the latest BotAPI
- Single file, small size, simple to upload.
- File download/upload
- Events
- WebHook & GetUpdates support
Requirements
If you can install Guzzle, you can use it easily.
Install
If you have Composer, you can install it very easily:
If you want to use the beta version:
If Composer is not installed, you can easily install it Here.
Get Update
You can get Update with two ways;
Webhook
If you are going to receive Updates with Webhook method, just add "true" to the handler.
Get Updates
This method is used by default. You don't need to add anything extra.
Events
With the new feature added to Boting 2.0, you can now add convenience commands and capture message types with on
.
$bot->command
The command, must be regex.
Example (Let's catch /start command):
Let's add another command handler:
The bot will now also respond to /start,!Start,.start
commands.
$bot->on
The bot will execute the function if a message of the specified type arrives.
No match is used, On.
Example (If the photo comes):
You can look at the On Types here.
$bot->answer
You can use the answer function to answer inline_query
orcallback_query
.
Example (Let's answer inline):
Special Events
If you do not want to use ready-made functions, you can define your own function.
❗️Type true
if you are going to use Webhook or false
if you will get it with GetUpdates.
Example (A function that responds to the /start message):
Commands
Commands are the same as BotAPI commands. You can use BotAPI commands in the same way.
Let's give an example you wanted to send a message,We look at the required parameters from BotAPI.
We need chat_id
andtext
. So let's write our code.
The process is complete. Commands return Array, after operation.
Examples
We can show this file as a very good example of using the library.
Also a code that responds to a simple /start
message:
Licence
This project is completely open source and protected under MIT license. Please refer to the LICENSE.md file
Contact
You can contact me on Telegram or open Issue.