Skip to content

agtong/yii2-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii2 Telegram Bot

Yii2 Telegram bot.

Installation

The preferred way to install this extension is through composer.

Either run

composer require agtong/yii2-telegram-bot

or add

"agtong/yii2-telegram-bot": "*"

to the require section of your composer.json file.

Usage

Use the below code to send a message.

$bot = new TelegramBot(['token' => '123456:abcde');
$bot->sendMessage('123456', 'Hello World!');

The sendMessage function and it's optional paramters are shown below.

sendMessage($chat_id, $text, $parse_mode = null, $disable_web_page_preview = null, $disable_notification = null, $reply_to_message_id = null, $reply_markup = null)

Read more about the parameters here.

Packages

No packages published

Languages