Описание
What started as a niche project for a niche modloader for a niche Minecraft version has now been extended to all Minecraft versions (that I personally care about)!
# Nilcord | Yet another Discord bridge for Minecraft
Nilcord connects the chat of your Minecraft server to a specified [Discord](https://en.wikipedia.org/wiki/Discord) text channel, using a Discord bot and (optionally) webhook.
## Installation
To get the mod set up, simply place the mod file in the `mods` directory (or `nilmods` with [NilLoader](https://git.sleeping.town/Nil/NilLoader)), start your Minecraft server, and wait for it to generate the config file (and crash because it's not yet populated).
The config file, named `nilcord.toml`, is found in the `config` folder, and is pretty self-explanatory.
(default configuration)
```toml
# Settings pertaining to Discord itself
[discord]
# The Discord bot token to use
# default:
token = ""
# The default Discord channel ID for the bot to send messages to / receive messages from. Used ALONGSIDE send_to and receive_from. Can be blank!
# default:
channel_id = ""
# Other Discord channel ID(s) for the bot to send messages to
send_to = []
# Other Discord channel ID(s) for the bot to receive messages from
receive_from = []
# Settings pertaining to the Discord webhook
[discord.webhook]
# Whether to use a webhook for sending players' chat messages to Discord
# default: false
enabled = false
# The webhook URL to use
# default:
url = ""
# Settings pertaining to Minecraft itself
[minecraft]
# Whether to allow mentioning Discord users from Minecraft
# default: false
enable_mentions = false
# Whether to allow mentioning @everyone and @here from Minecraft
# default: false
enable_everyone_and_here = false
# Whether to show Discord message attachments in-game
# default: true
show_attachments = true
# Whether to show messages from other Discord bots in-game
# default: false
show_bot_messages = false
# Whether to show messages from Discord webhooks in-game
# default: true
show_webhook_messages = true
# Application / User IDs to ignore messages from
ignored_ids = ["000000000000000000"]
# Settings pertaining to message formatting
[formatting]
# Settings pertaining to messages visible in Discord
# Available placeholders:
[formatting.discord]
# Server starting message
# Available placeholders: N/A
# default: **Server starting...**
server_starting_message = "**Server starting...**"
# Server started message
# Available placeholders: N/A
# default: **Server started!**
server_started_message = "**Server started!**"
# Server stopping message
# Available placeholders: N/A
# default: **Server stopping...**
server_stopping_message = "**Server stopping...**"
# Server stopped message
# Available placeholders: N/A
# default: **Server stopped!**
server_stopped_message = "**Server stopped!**"
# Server crash message
# Available placeholders: N/A
# default: **Server crashed :(**
server_crash_message = "**Server crashed :(**"
# Player chat messages
# Additional placeholders:
# default: ****
chat_message = "**** "
# Player join messages
# Additional placeholders: N/A
# default: > ** joined the game**
join_message = "> ** joined the game**"
# Player leave messages
# Additional placeholders: N/A
# default: > ** left the game**
leave_message = "> ** left the game**"
# Player advancement messages
# Additional placeholders:
# default: > **** has just earned the achievement **[]**
#> \> __
advancement_fallback_message = "> **** has just earned the achievement **[]**\n> \\> __"
# default: > **** has completed the challenge **[]**
#> \> __
advancement_challenge_message = "> **** has completed the challenge **[]**\n> \\> __"
# default: > **** has reached the goal **[]**
#> \> __
advancement_goal_message = "> **** has reached the goal **[]**\n> \\> __"
# default: > **** has made the advancement **[]**
#> \> __
advancement_task_message = "> **** has made the advancement **[]**\n> \\> __"
# Player death messages
# Additional placeholders:
# default: ** died:** __
death_message = "** died:** __"
# Settings pertaining to messages sent from the webhook, if enabled
[formatting.discord.webhook]
# The URL to use for the webhook's avatar
# Additional placeholders:
# default: https://visage.surgeplay.com/bust/128/?
avatar_url = "https://visage.surgeplay.com/bust/128/?"
# Default skin ID for the webhook's avatar, if the player's cannot be loaded
# default: 31f477eb1a7beee631c2ca64d06f8f68fa93a3386d04452ab27f43acdf1b60cb
default_skin_id = "31f477eb1a7beee631c2ca64d06f8f68fa93a3386d04452ab27f43acdf1b60cb"
# Default skin model for the webhook's avatar, if the player's cannot be loaded
# default: wide
default_skin_model = "wide"
# The webhook's username
# Additional placeholders: N/A
# default:
username = ""
# Player chat messages
# Additional placeholders:
# default:
chat_message = ""
# Settings pertaining to messages visible in Minecraft
# Available placeholders:
[formatting.minecraft]
# Discord messages
# Additional placeholders:
# default: [Discord]
discord_message = "[Discord] "
# Username format
# Additional placeholders: N/A
# default:
username_format = ""
# Mention format
# Additional placeholders: N/A
# default: @
mention_format = "@"
# Reply format
# Additional placeholders:
# default: [←]
reply_format = "[←] "
# Attachment format
# Additional placeholders:
# default: [Attachment]
attachment_format = "[Attachment]"
```
(Note that this is the config file for Nilcord `4.2+26.2+fabric`. It may look different on other versions.)
Only the `token` and `channel_id` fields (under the `discord` category) are *strictly required* to be filled out; the mod falls back to sensible defaults for everything else. But feel free to change it to your liking!
## Notes
For setting up a Discord application (to get a bot token), follow discord.js' guide: [Setting up a bot application | discord.js Guide](https://discordjs.guide/preparations/setting-up-a-bot-application.html)
For finding a Discord channel's "Channel ID", follow Discord's guide: [Where can I find my User/Server/Message ID? - Discord](https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID#h_01HRSTXPS5FMK2A5SMVSX4JW4E)
With 1.21.1 and below, the Fabric versions can also make use of the [Simplified Text Format](https://placeholders.pb4.eu/user/text-format/), as well as placeholders supplied by [Text Placeholder API](https://modrinth.com/mod/placeholder-api) and the various mods that support it.
With 1.21.2 and above, the Fabric versions allow using [QuickText](https://placeholders.pb4.eu/user/quicktext/) as well.
With 1.20.4, as well as 26.1 and above, the NeoForge versions also allow using Simplified Text Format and QuickText.
The Forge 1.7.10 version has additional support for [ChromatiCraft](https://www.curseforge.com/minecraft/mc-mods/chromaticraft)'s progression messages, as well as [ServerUtilities](https://github.com/GTNewHorizons/ServerUtilities)' AFK messages.
***
Comments? Questions? Suggestions? Demands? Open an issue on the [issue tracker](https://github.com/unilock/nilcord/issues)!