[mod] Telegram Bridge [telegram]

Post Reply
User avatar
Elinvention
New member
Posts: 8
Joined: Tue Jul 23, 2013 12:27
GitHub: Elinvention
Location: Tuscany, Italy
Contact:

[mod] Telegram Bridge [telegram]

by Elinvention » Post

I made this mod to bridge my Minetest server's chat to a Telegram group. For those who don't know, Telegram is an instant messaging application with an open source client.

I made this mod because all I could find on the Internet was a quite complex mod with a python web server. After I wrote this, I found another mod here on the forum. However I claim my solution is better because my mod uses long polling to wait for messages.

Features
  • Messages from Minetest chat are repeated in the Telegram group and vice-versa.
  • Player join and server shutdown/startup are announced in the Telegram group.
  • Deaths, joins and leaves are announced in the Telegram group too with disabled notifications (no sound).
How to install
  1. Install this mod like any other mod.
  2. You need a Telegram bot. Create one following the Telegram documentation.
  3. Ask BotFather to disable bot privacy, to allow the bot to read any message.
  4. Add the bot to the target group chat and send a message.
  5. Open a web browser and open this URL https://api.telegram.org/bot<token>/getUpdates replacing with the token given to you by BotFather. You should find the correct chat id (it's a number).
  6. Open your minetest.conf file in a text editor and add these 2 lines:
    1. telegram.token = "put here your bot's token". The token is the one that BotFather gave you.
    2. telegram.chat_id = "put here your chat id". The chat ID is the one you should have found earlier.
  7. Start your Minetest server and enjoy.
Source code

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests