Sync message between telegram group and fabric minecraft server.
- Sync chat messages between minecraft server and telegram group.
- Good support for different telegram message type.
- Send server messages (like players joining the server) to telegram group.
- Query online player list in the group.
- Run server commands from the group (admins only).
- Download this mod from Releases and dependencies Fabric API, Fabric Language Kotlin. Put them in your server
mods
directory. - Start the server to generate a default configuration file.
- Create a telegram bot at BotFather and obtain your bot token. Remember to disable
Privacy mode
if you want to send group message to minecraft. - Open your configuration file (at
config/tgbridge/config.json
) and write in your bot token. - Use command
/tgbridge_reload
on your server to reload the configuration. - Add your bot to your group, and run
/chatid
in the group to get group chat ID. - Write your group chat ID in your configuration file and reload like step 5.
- Enjoy!
The configuration file is located at config/tgbridge/config.json
. It's a json file (obviously😋).
A detailed explanation is here.
Field | Type | Detail |
---|---|---|
botToken | String | Your bot token. |
chatId | Int | Your group chat ID. |
telegramAPI | String | The API url. Change this if you want to use a reversed proxy. |
pollTimeout | Int | The bot keeps sending requests to telegram server to obtain new messages. If no new messages is aquired for value seconds, the bot will send a request again. Smaller value is recommended if your network is not good. |
sendChatMessage | Boolean | Whether to send game chat messages to your group. |
sendGameMessage | Boolean | Whether to send game event messages to your group. |
sendTelegramMessage | Boolean | Whether to send telegram messages to Minecraft. |
messageTrim | Int | Trim the message sent to Minecraft if it is longer than value . Use 0 to disable trimming. |
sendServerStarted | Boolean | Whether to send server started message to your group. |
sendServerStopping | Boolean | Whether to send server stopping message to your group. |
minecraftFormat | String | How group chat messages look like in minecraft. %1$s for sender's name. %2$s for the message. |
telegramFormat | String | How minecraft chat messages look like in telegram group. %1$s for sender's name. %2$s for the message. Support some HTML style formatting |
serverStartedMessage | String | What will be sent to group when the server has started. |
serverStoppingMessage | String | What will be sent to group when the server is stopping. |
admins | String[] | Admins who can run game commands in the group. Use telegram username . |
noPermission | String | What will be replied when someone who is not admin uses /cmd in the group. |
Edit config/tgbridge/i18n.json
.
On the PC you play Minecraft, open minecraft/assets/indexes/{version}.json
. (change {version} to your server version). Search for {your language code}.json
(such as en_gb.json
) and remember the hash
next to it. Now we will use 482e0dae05abfa35ab5cb076e41fda77b4fb9a08
as an example.
Go to .minecraft/assets/objects/48/
(change 48
to the first to char of the hash), copy the file with name of that hash to somewhere else and rename it lang.json
. Now you can replace config/tgbridge/lang.json
with your new file.