Download the PHP package uzdevid/yii2-telegram without Composer
On this page you can find all versions of the php package uzdevid/yii2-telegram. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-telegram
Extension for develop telegram bot
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Create telegram
extension with config params
Set and delete webhook
$url
- url to Your handler
Send
Send text [docs]
$text
- [string
|required
] - message text.$params
- [array
|optional
] - additional params: parse_mode, entities, disable_web_page_preview and other. Read the telegram bot docs...$chat_id
- [integer
|required
] - telegram user chat id.Note: All send requests return a response from telegram
Example
Send photo [docs]
$photo
- [string
|required
] - path to photo.$params
- [array
|optional
] - additional params: parse_mode, caption_entities, disable_notification and other. Read the telegram bot docs...$text
- [string
|optional
] - caption for photo.$chat_id
- [integer
|required
] - telegram user chat id.
or you can send a photo without a caption
Send video [docs]
$video
- [string
|required
] - path to video.$params
- [array
|optional
] - additional params: duration, width, height and other. Read the telegram bot docs...$text
- [string
|optional
] - caption for video.$chat_id
- [integer
|required
] - telegram user chat id.
or you can send a video without a caption
Send sticker [docs]
$sticker
[string
|required
] - sticker id.$params
- [array
|optional
] - additional params: disable_notification, protect_content, reply_to_message_id and other. Read the telegram bot docs...$chat_id
- [integer
|required
] - telegram user chat id.
Send contact [docs]
$phone
[string
|required
] - phone number.$first_name
[string
|required
] - first name.$last_name
[string
|optional
] - last name.$params
- [array
|optional
] - additional params: vcard, disable_notification, protect_content and other. Read the telegram bot docs...$chat_id
- [integer
|required
] - telegram user chat id.
Send poll [docs]
$question
- [string
|required
] - Question.$options
- [array
|required
] - Options.$correct_option_id
- [integer
|optional
] - Correct option id, Required for polls in quiz mode.$params
- [array
|optional
] - additional params: type, allows_multiple_answers, explanation and other. Read the telegram bot docs...
Send message, photo, video, sticker and poll with inline keyboard and/or keyboard
Keyboard
URL inline keyboard
callback inline keyboard
Handlers
Note: When processing requests, there is no need to specify a chat id when sending a response to a request.
Processing /start
request
Processing callback query
Processing all (*) inline query