Hi all!
I made a Telegram Bot (written in Python) that via [B]telnet[/B] can launch commands to TrinityCore console.
[SIZE=14px]What is Telegram?[/SIZE]
Telegram is an instant messaging system focusing on privacy and multi-platform availability. Telegram clients exist for both mobile (Android, iOS, Windows Phone) and desktop systems (Windows, OS X, Linux).[11][12] Telegram users can exchange messages encrypted end-to-end, self-destructing messages, along with photos, videos, stickers, and files of any type up to 1.5 GB in size. [Wikipedia]
https://s4.postimg.io/gtys538x9/telegram.png
So it's a software like Whatsapp but it's better! (In Whatsapp you can't make your own Bot).
I made this bot for Admin/GM that may wants to launch some announce, resolve tickets, kick or teleport someone but they havne't the client.
Telegram is a software cross-platform so also from smartphone, Desktop (with any OS installed) you can send message to the bot, so launch the command.
[SIZE=14px]Examples[/SIZE]:
https://raw.githubusercontent.com/Helias/TC-Telegram-Bot/master/Example1.png
https://raw.githubusercontent.com/Helias/TC-Telegram-Bot/master/Example2.png
For now the available commands are the follow (that you can see just asking to the bot "/help"):
https://s4.postimg.org/zehrn3y25/commands.png
[SIZE=14px]Security[/SIZE]
You are probably wondering “If I can send message to the bot and launch command, anybody can send message to the bot and launch command from my server!” yes.,… but nope! You can add a condition filter to this line that active the bot only with your chat throught the chat_id:
https://github.com/Helias/TC-Telegram-B … bot.py#L72
just adding "and chat_id == your_chat_id".
What is chat_id? Anyone on Telegram has a chat_id which any bot use to recognize you and send a message.
How can I find my chat_id? You can obtain your chat id just sending /chatid to @GiveChatId_Bot (A bot that I made).
(if you want to obtain the chatid of a group you must invite @GiveChatId_Bot to the group and write /chatid, the chat_id of the gorup usually are negative).
[SIZE=14px]If you don’t know how to set up a basic Telegram Bot, read this first: https://core.telegram.org/bots and talk with @BotFather[/SIZE]
How to install it
To run this bot you need the python-telegram-bot library, you can install it by
pip install python-telegram-bot
To install it from source you can download it from [https://github.com/leandrotoledo/python-telegram-bot](https://github.com/leandrotoledo/python-telegram-bot)
After installing the client you must configure it settings the following parameters:
HOST = "127.0.0.1" #IP of the server
port = 3443 #Port of the server
username = "" #Username telnet access
password = "" #Password telnet access
logs = 1 #Enable/Disable logs (1/0)
TOKEN = "" #Token of your telegram bot that you created from @BotFather
The last parameter it's the Token of your bot that you receive while creating it with @BotFather (ask this bot on telegram).
After configuration you can run your bot, remind to enable telnet in etc/worldserver.conf (RA.* settings) and open your worldserver.
FAQ
My bot[B] doesn't run[/B] and return the follow [B]error[/B]:
LAST_UPDATE_ID = bot.getUpdates()[-1].update_id
IndexError: list index out of range
Send a message to your Bot and (re)run the file telegrambot.py.