Download the PHP package dannsbass/bots without Composer
On this page you can find all versions of the php package dannsbass/bots. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download dannsbass/bots
More information about dannsbass/bots
Files in dannsbass/bots
Download dannsbass/bots
More information about dannsbass/bots
Files in dannsbass/bots
Vendor dannsbass
Package bots
Short Description Simple Telegram Bot API library for PHP
License MIT
Homepage https://github.com/dannsbass/bots
Package bots
Short Description Simple Telegram Bot API library for PHP
License MIT
Homepage https://github.com/dannsbass/bots
Please rate this library. Is it a good library?
Informations about the package bots
Bots
Simple Telegram Bot API library for PHP
Quick Start
Initiate with setToken
and end with run
method.
Sample 1: Start
Sample 2: Keyboard
Sample 3: Inline Keyboard
Sample 4: Sending Document
Sample 5: Chat Array
Sample 6: Regex
Documentation
Note that all properties and methods are static. For example: Bot::$property
or Bot::method()
.
Bot Properties
Property | Type | Description |
---|---|---|
token | string | bot token from @BotFather |
name | string | bot name from @BotFather |
url | string | telegram URL for endpoint |
getUpdates | array | parsed-JSON from Telegram server |
inputObject | object | decoded-JSON from Telegram server |
_command | array | list of commands and responses |
_onMessage | array | list of events (types) and the responses |
version | integer | app version |
message_id | string | message ID |
message_text | string | message text |
user | string | first name (and last name) |
from_id | integer | from ID |
chat_id | integer | from ID |
admin_id | integer | admin ID |
Bot Methods
Method | Parameter(s) | Description |
---|---|---|
setToken | string bot token, string bot name |
|
setAdmin | integer admin ID |
|
isAdmin | to check if user is admin | |
name | to get bot name | |
chat | string command, string or callable response |
to set command and its response |
cmd | string command, string or callable response |
to set command and its response |
chat_array | associative array list of command (key) and its response (value) |
to set command and its response |
keyboard | string keyboard pattern, string input_field_placeholder = 'type here', boolean resize_keyboard = true, boolean one_time_keyboard = true |
to create keyboard(s) from string |
inline_keyboard | string keyboard pattern |
to create inline keyboard(s) from string |
message_id | to get message id | |
message_text | to get message text | |
user | to get user first name (and last name) | |
from_id | to get user ID | |
chat_id | to get chat ID | |
on | string type, string or callable response |
to set response |
regex | string pattern, string or callable response |
to set response |
run | to run the bot | |
send | string method, associative array data |
to send request to Telegram server |
answerInlineQuery | result, array options = [] |
to answer Inline Query |
answerCallbackQuery | text, array options = [] |
to answer Callback Query |
message | to get body of message JSON from user | |
type | to get type of message | |
__callStatic |
string method, array parameters |
to call any method |
prosesPesan | string teks, array data = null |
to send a long message |
bg_exec | string function name, array parameters, string PHP script to be loaded first, integer timeout = 1000 |
to call function in background |
Telegram Events
Note that event parameters up to 2 parameters. For example: Bot::start($param1, $param2)
.
all
(when user sends anything, it's similar withon('*', $response)
method)start
(when user sends/start
text message or pressesSTART
button)text
(see: docs)animation
audio
document
photo
sticker
video
video_note
voice
contact
dice
game
poll
venue
location
message_auto_delete_timer_changed
pinned_message
invoice
successful_payment
user_shared
chat_shared
write_access_allowed
passport_data
proximity_alert_triggered
forum_topic_created
forum_topic_edited
forum_topic_closed
forum_topic_reopened
general_forum_topic_hidden
general_forum_topic_unhidden
voice_chat_scheduled
voice_chat_started
voice_chat_ended
voice_chat_participants_invited
inline_query
callback_query
edited_message
channel_post
edited_channel_post
Telegram Methods
All Telegram methods are compatible with this bot. For example:
See more: https://core.telegram.org/bots/api#available-methods
All versions of bots with dependencies
PHP Build Version
Package Version
Requires
danog/tg-file-decoder Version
^0.1.13
The package dannsbass/bots contains the following files
Loading the files please wait ....