2015-12-31 13:48:56 -06:00
|
|
|
# DennyDai/D-Bot/Telegram-Bot
|
|
|
|
|
|
|
|
Based on [Telegram Bot API](https://core.telegram.org/bots)
|
|
|
|
|
2015-12-31 13:49:42 -06:00
|
|
|
## Step 1: Get Your Telegram Bot Token
|
2015-12-31 13:48:56 -06:00
|
|
|
|
|
|
|
[How do I create a bot?](https://core.telegram.org/bots#3-how-do-i-create-a-bot)
|
|
|
|
|
2015-12-31 13:49:42 -06:00
|
|
|
## Step 2: Set WebHook for Your bot
|
2015-12-31 13:48:56 -06:00
|
|
|
|
|
|
|
Run
|
|
|
|
```
|
|
|
|
cp Telegram-Bot.php VAR_BOT.php
|
|
|
|
```
|
2015-12-31 13:49:42 -06:00
|
|
|
The url of Webhook is https://YourHost/D-Bot/Telegram-Bot.php
|
2015-12-31 13:48:56 -06:00
|
|
|
|
|
|
|
Don't know how to set Webhook for Telegram Bot? See it --> [setWebhook](https://core.telegram.org/bots/api#setwebhook)
|
|
|
|
|
2015-12-31 13:49:42 -06:00
|
|
|
## Step 3: Add Your Telegram Bot Token to Config.php
|
2015-12-31 13:48:56 -06:00
|
|
|
|
|
|
|
```
|
|
|
|
define('TB_TOKEN', 'YOUR_TELEGRAM_BOT_TOKEN_HERE');
|
|
|
|
```
|
|
|
|
|
|
|
|
And then start your php server and enjoy your bot.
|
|
|
|
|
|
|
|
####Have fun :)
|