Skip to content

Discord <-> ingame chat bridge for the Tellurium network.

License

Notifications You must be signed in to change notification settings

TelluriumMC/TelluriumChatBridge

Repository files navigation

Overview

wakatime CodeFactor Mod loader: Fabric GitHub repo size GitHub GitHub last commit GitHub release (latest SemVer including pre-releases)

Server-side FabricMC mod featuring a Discord <-> Minecraft chat bridge for the Tellurium network, with multiple features not found in other chat bridge mods.

Built with JDA, Mineskin, and Oro-Config.

- This is my first time using Java, so this code might not have the best practices in it.

Contents

Features

Multiple Discord Channel Support

Broadcast messages from multiple Discord channels into Minecraft, from multiple different servers! This also features Discord to Discord chat bridging, so you won't miss a message. This also supports attachments! Upload images and files, and they will be sent through too, and if a message contains an attachment, this will show in Minecraft chat too!

image

Channel One

channel-1

Channel Two

channel-2

3d Head Rendering

Discord webhooks allow us to set our own avatar for each message, which means we can set them based on the player who talks. Thanks to Mineskin, we are able to generate a rendered image of the player's head.

image

Death Messages, Player Connections and Server Starting Announcements

Broadcast player death messages, join and leave messages, and server start/stop messages straight to Discord.

image

image*

image

*Discord formatting was broken in this screenshot. It has since been updated to _Skypie_ was shot by Skeleton

Discord Bot Commands

Commands to check the server's health (TPS, and MSPT), the current players online, and the bot's latency, are all prebuilt into the Discord bot.

image

image

image

Json Configuration

An automatically generating config file, with the ability to customize everything! See configuration below.

Console Logging

Logs all messages in the server console, as well as errors and initialization.

image

Setup

  • Download the .jar file at either the GitHub releases page, or download the artifact from the latest build.
  • Move the .jar file into server/mods and run the server using your startup script.
  • After the server crashes, edit the config file at server/config/tellurium-chat-bridge.json (See configuration for more)
  • You're good to go!

Configuration

Example configuration file:

{
  "tellurium_chat_bridge_config": {
    "discord_bot_token": "Bot token here",
    "server_name": "TMP",
    "discord_channel_ids": [
      "866299513476343962",
      "836222513389183949",
      "821686696895737887"
    ],
    "webhook_urls": [
      "https://discord.com/api/webhooks/821686696895737887/FQO9otfxTI6Ml7mMY6dt-5IpkS81KhYnvz-EgmcwfFm7G1_PNg8cvwAFOjD4QaVC_cdY",
      "https://discord.com/api/webhooks/866299513476343962/35kSpD_NjepvJ6WOXY9FAHZ1l7bWOUkxelyQieLPKUPtjjzXm4dwf7AdsNv45HIpPA2A"
    ],
    "discord_to_minecraft_formatting": "{player_name} §9§lD §r§8»§r {attachment} {text}",
    "bot_prefix": "!"
  }
}

(Yes, these webhook URLs are fake)


discord_bot_token - Your Discord bot token.

How do I get a Discord bot token? Go to https://discordapp.com/developers.

Click My apps in the top left:

img Click New App:

img Give your bot a name and optionally a description and avatar:

img Click Create App:

img Scroll down and click Create a Bot User:

img Click Yes, do it!:

img Click click to reveal nex to Token::

img

server_name - The name of the server (for example SMP, CMP, etc).

discord_channel_ids - An array of Discord channel ids. Make sure to add a comma after each item.

webhook_urls - An array of Discord webhook URLs. Make sure to add a comma after each item.

discord_to_minecraft_formatting - Formatting for what Minecraft chat sees for Discord messages.

property use
{player_name} the author's name of the Discord message
{attachment} where <Attachment> shows when an attachment is sent through Discord
{text} the raw message that was sent to Discord

bot_prefix - The prefix that the bot uses when typing commands.

Commands

command alias use
ping ping Returns bot latency
online online, players, playing Returns current online players
health health, stats, tps, mspt Returns server health (tps & mspt)

About

Discord <-> ingame chat bridge for the Tellurium network.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages