fooooooooooooooo / VelocityDiscord

Velocity global chat/discord bridge
GNU Lesser General Public License v2.1
21 stars 10 forks source link

Allow customization of webhook username #12

Closed unilock closed 1 year ago

unilock commented 1 year ago

This commit allows the webhook username to be customized via the plugin config. Specifically, it adds a key "discord.webhook.webhook_username" to config.toml that is interpreted as the format of the webhook's username, replacing the variables {username} and {server} with the username and current server, respectively, of the player sending a Minecraft chat message.

Example: [{server}] {username} = [vanilla] player1

I also took the liberty of reformatting the default config file, so feel free to crucify me for that :) (on that note, it might be a good idea to reformat the config file (even more!) to make it more readable, but I figure I've gone far enough already)

Also, I merged the server connect methods, using ServerConnectedEvent rather than PlayerChooseInitialServerEvent and ServerPostConnectEvent separately. This fixes #11.