thecatcore / Fabric---Discord-Link

MIT License
75 stars 31 forks source link

Fabric<->Discord Link

Fabric-Discord-Link is a lightweight server mod for the fabric mod loader which links your minecraft server and it's chat to a discord server via your very own discord bot.

Features

Installation

Dependencies

For Minecraft 1.14.4, 1.15.2 and any version (including snapshots) newer than 1.16.1:

Fabric-Discord-Link requires Fabric API to work. The Fabric-API jar needs to be in your mod folder.

For other Minecraft version (including snapshots):

No dependencies required.

Obtaining the binaries

The release binaries are available on curseforge and modrinth.

After downloading the latest version, just drop the jar into the mods folder.

Building from source

  1. Download the repository
  2. Follow this guide to setup gradle and build the project
  3. Drop the resulting jar into the fabric mod folder

Acquiring and configuring a Discord Bot

  1. Go to the discord developer portal and register a new Application
  2. Register a new Bot for the application in the <Bot> tab to the left
  3. Toggle <Server Members Intent> to on under <Priviledged Gateway Intents> after creating a bot
  4. In the <OAuth2> Tab to the left, select the <bot> option under <Scopes> and select the options <View Channels> and <Send Messages>
    • Also select the <Manage Channels> permissions if you intend to enable custom channel descriptions.
  5. Copy the URL generated under <Scopes> and open it in a new tab to add the bot to your discord server

Configuring Fabric-Discord-Link

  1. Start your minecraft server once to let Fabric-Discord-Link generate it's default config <fdlink.json>
  2. Turn your server back off
  3. Copy your Bots Token from the Discord Developer Portal and paste it into the empty double quotes behind <"token"> in the config
  4. Obtain the channel IDs of the channels that you want your bot to function in (these can be from separate discord servers). To do this, you need to enable Discords Developer mode in your Discord Settings under <Appearance>. Afterwards you can right click channels and select <Copy ID> at the bottom
  5. Paste the Discord Chat and/or Log Channel's IDs into the appropriate locations in the config. The IDs need to be in double quotes inside the brackets. If you have more than one Chat or Log Channel you need to separate the channel IDs inside the brackets with commas (no comma behind the last ID)
  6. Configure the other settings in the config to your liking
    • When you set a certain message type to false, those messages will still go to any logChannel you configured, but they won't be sent to chatChannels
    • When minecraftToDiscordDiscriminator is set to true, messages sent from Discord into Minecraft will have the exact Discord name, e.g. Bob#1234 instead of just Bob
  7. Restart your server