PHPackages                             pun2006/yii2-bot-telegram - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pun2006/yii2-bot-telegram

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

pun2006/yii2-bot-telegram
=========================

bot telegram

v1.0.0(2y ago)04LGPL-3.0+PHP

Since Apr 26Pushed 2y agoCompare

[ Source](https://github.com/pun2006/yii2-bot-telegram)[ Packagist](https://packagist.org/packages/pun2006/yii2-bot-telegram)[ RSS](/packages/pun2006-yii2-bot-telegram/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Yii2 bot telegram
==================

[](#yii2-bot-telegram)

 [![](https://camo.githubusercontent.com/f5c93bdade0ac8d93728c5e98a11348ec61281cbd0929192ccbcbe1dd3107bf9/68747470733a2f2f692e6962622e636f2f4a5178445a57482f74656c656772616d2e706e67)](https://camo.githubusercontent.com/f5c93bdade0ac8d93728c5e98a11348ec61281cbd0929192ccbcbe1dd3107bf9/68747470733a2f2f692e6962622e636f2f4a5178445a57482f74656c656772616d2e706e67)

[![Latest Stable Version](https://camo.githubusercontent.com/4ef9416da108037330907bb8f4ecd4023076df743778f99c37195e611f188b4e/68747470733a2f2f706f7365722e707567782e6f72672f616b692f796969322d626f742d74656c656772616d2f76657273696f6e)](//packagist.org/packages/aki/yii2-bot-telegram)[![Total Downloads](https://camo.githubusercontent.com/044758280d27c0811d4d439e214be683a47a07a8b9affb948bfee03a8b85a21b/68747470733a2f2f706f7365722e707567782e6f72672f616b692f796969322d626f742d74656c656772616d2f646f776e6c6f616473)](https://packagist.org/packages/aki/yii2-bot-telegram)[![Latest Unstable Version](https://camo.githubusercontent.com/72dfe0da4e6e62b429f5032938d873f09f34241125b2676bc195a27b084d6749/68747470733a2f2f706f7365722e707567782e6f72672f616b692f796969322d626f742d74656c656772616d2f762f756e737461626c65)](https://packagist.org/packages/aki/yii2-bot-telegram)[![License](https://camo.githubusercontent.com/b7780227239495806a99df0267bf36d99941e0f0b0c03d74e881398239e5fafb/68747470733a2f2f706f7365722e707567782e6f72672f616b692f796969322d626f742d74656c656772616d2f6c6963656e7365)](https://packagist.org/packages/aki/yii2-bot-telegram)[![Monthly Downloads](https://camo.githubusercontent.com/8cdd4197a03db481a88f7346d298026812539df4f2e08d53471a8f52ff86c15f/68747470733a2f2f706f7365722e707567782e6f72672f616b692f796969322d626f742d74656c656772616d2f642f6d6f6e74686c79)](https://packagist.org/packages/aki/yii2-bot-telegram)[![Daily Downloads](https://camo.githubusercontent.com/29bc7e04d59bba3482c6ec56f9a79267537348b95b2558b199f8b14c59c5d12b/68747470733a2f2f706f7365722e707567782e6f72672f616b692f796969322d626f742d74656c656772616d2f642f6461696c79)](//packagist.org/packages/aki/yii2-bot-telegram)

[guide-ru](https://github.com/akbarjoudi/yii2-bot-telegram/tree/master/docs/guide-ru)

Create your first bot
---------------------

[](#create-your-first-bot)

1. Message @botfather  with the following text: `/newbot` If you don't know how to message by username, click the search field on your Telegram app and type `@botfather`, where you should be able to initiate a conversation. Be careful not to send it to the wrong contact, because some users has similar usernames to `botfather`.

    [![createbot](https://cloud.githubusercontent.com/assets/11705808/19187517/c1179cc8-8c98-11e6-84fe-a8570388931c.PNG)](https://cloud.githubusercontent.com/assets/11705808/19187517/c1179cc8-8c98-11e6-84fe-a8570388931c.PNG)
2. @botfather replies with `Alright, a new bot. How are we going to call it? Please choose a name for your bot`.
3. Type whatever name you want for your bot.
4. @botfather replies with `Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: PostManGoBot or PostManGo_bot`.
5. Type whatever username you want for your bot, minimum 5 characters, and must end with bot. For example: `PostMan_bot`.
6. @botfather replies with:

    ```
    Done! Congratulations on your new bot. You will find it at
    telegram.me/telesample_bot. You can now add a description, about
    section and profile picture for your bot, see /help for a list of
    commands.

    Use this token to access the HTTP API:
    123456789:AAG90e14-0f8-40183D-18491dDE

    For a description of the Bot API, see this page:
    https://core.telegram.org/bots/api

    ```
7. Note down the 'token' mentioned above.
8. Type `/setprivacy` to @botfather.

    [![capture](https://cloud.githubusercontent.com/assets/11705808/19187624/4ba64434-8c99-11e6-975d-737075f92d46.PNG)](https://cloud.githubusercontent.com/assets/11705808/19187624/4ba64434-8c99-11e6-975d-737075f92d46.PNG)
9. @botfather replies with `Choose a bot to change group messages settings`.
10. Type (or select) @PostMan\_bot (change to the username you set at step 5 above, but start it with @)
11. @botfather replies with.

    ```
    'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.
    'Disable' - your bot will receive all messages that people send to groups.
    Current status is: ENABLED

    ```
12. Type (or select) `Disable` to let your bot receive all messages sent to a group. This step is up to you actually.
13. @botfather replies with `Success! The new status is: DISABLED. /help`

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require aki/yii2-bot-telegram "*"

```

or add

```
"aki/yii2-bot-telegram": "*"

```

to the require section of your `composer.json` file.

Method list usable
------------------

[](#method-list-usable)

list methods

```
getMe
sendMessage
forwardMessage
sendPhoto
sendAudio
sendDocument
sendSticker
sendVideo
sendLocation
sendChatAction
getUserProfilePhotos
getUpdates
setWebhook
getChat
getChatAdministrators
getChatMembersCount
getChatMember
answerCallbackQuery
editMessageText
editMessageCaption
sendGame
Game
Animation
CallbackGame
getGameHighScores
GameHighScore
answerInlineQuery
setChatStickerSet
deleteChatStickerSet
leaveChat
pinChatMessage
unpinChatMessage
setChatDescription
setChatTitle
deleteChatPhoto
exportChatInviteLink
promoteChatMember
restrictChatMember
unbanChatMember
kickChatMember
editMessageLiveLocation
stopMessageLiveLocation

```

Usage
-----

[](#usage)

first add to config.php

```

```

Once the extension is installed, simply use it in your code by :

```
