Skip to content

Conversation

@x86-39
Copy link
Contributor

@x86-39 x86-39 commented Nov 16, 2022

Information

This PR partially closes #5155

Details

Proposed feature:
Add a template for the webhook name instead of hardcoding the three options (bot name, username, display name) as booleans.
This removes the options show-name and show-displayname. They are still read as a fallback for if this new format is undefined.

The default behaviour currently is to use the bots name, so the default template is {botname}. botname is a placeholder for the bots name in the server.

Environments tested:

OS: Fedora 36

Java version: 17.0.5

  • Most recent Paper version (1.XX.Y, git-Paper-BUILD)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8
    Don't see how this could differ on other server versions.

Demonstration:

show-avatar: true

...

  # This is the message that is used to relay minecraft chat in Discord.
  # The following placeholders can be used here:
  # - {username}: The username of the player sending the message
  # - {displayname}: The display name of the player sending the message (This would be their nickname)
  # - {message}: The content of the message being sent
  # - {world}: The name of the world the player sending the message is in
  # - {prefix}: The prefix of the player sending the message
  # - {suffix}: The suffix of the player sending the message
  # ... PlaceholderAPI placeholders are also supported here too!
  mc-to-discord: "{message}"
  # This is the format for the webhook names that are used when webhooks are enabled (show-avatar)
  # The following placeholders can be used here:
  # - {username}: The username of the player sending the message
  # - {displayname}: The display name of the player sending the message (This would be their nickname)
  # - {world}: The name of the world the player sending the message is in
  # - {prefix}: The prefix of the player sending the message
  # - {suffix}: The suffix of the player sending the message
  # - {botname}: Name of the Discord bot
  # ... PlaceholderAPI placeholders are also supported here too!
  mc-to-discord-name-format: "[%luckperms_primary_group_name%] {displayname}"

image

JRoy
JRoy previously approved these changes Apr 10, 2023
@JRoy JRoy changed the title Allow configuring webhook name with greater control for Discord Allow configuring Discord webhook name Apr 10, 2023
@JRoy JRoy enabled auto-merge (squash) April 10, 2023 00:25
@JRoy JRoy merged commit 384f63b into EssentialsX:2.x Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants