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).
- Install this mod like any other mod.
- You need a Telegram bot. Create one following the Telegram documentation.
- Ask BotFather to disable bot privacy, to allow the bot to read any message.
- Add the bot to the target group chat and send a message.
- 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).
- Open your minetest.conf file in a text editor and add these 2 lines:
- telegram.token = "put here your bot's token". The token is the one that BotFather gave you.
- telegram.chat_id = "put here your chat id". The chat ID is the one you should have found earlier.
- Start your Minetest server and enjoy.