EssentialsX

EssentialsX

2M Downloads

Allow toggling SUPPRESS_NOTIFICATIONS for some message types sent to Discord

jtopian opened this issue ยท 0 comments

commented

Feature description

I would like to be able to set certain message types so that they are sent to Discord with the SUPPRESS_NOTIFICATIONS message flag.

This would be a property in the config.yml that would accept a list of message types:

# To disable a message from showing, use 'none' as the channel name.
message-types:
  # Join messages sent when a player joins the Minecraft server for the first time. This type is sent instead of the join type.
  first-join: primary
  # Join messages sent when a player joins the Minecraft server.
  join: primary
  # Leave messages sent when a player leaves the Minecraft server.
  leave: primary
  # Chat messages sent when a player chats on the Minecraft server.
  chat: primary
[...cutting out a bunch for space...]

# Add message-types from above to the following list to suppress notifications in discord
suppress-notifications:
  - join
  - leave

then somewhere around the public class DiscordChatMessageEvent, check if the message type matches the list and add the flag before submitting the message to the Discord API.

How the feature is useful

This would help prevent messages like joins and quits from spamming notifications to Discord channel members, who might otherwise mute the channel completely to remove the noise.