Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ public boolean isShowDisplayName() {
return config.getBoolean("show-displayname", false);
}

public boolean isSendTypeAsWebhook(String key) {
return config.getBoolean("send-types-as-player." + key, true);
}

public String getAvatarURL() {
return config.getString("avatar-url", "https://crafthead.net/helm/{uuid}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,12 @@ private void sendDiscordMessage(final MessageType messageType, final String mess
String avatarUrl = null;
String name = null;
UUID uuid = null;

if (player != null && !jda.getSettings().isSendTypeAsWebhook(messageType.getKey())) {
sendDiscordMessage(messageType, message);
return;
}

if (player != null) {
if (jda.getSettings().isShowAvatar()) {
avatarUrl = DiscordUtil.getAvatarUrl(jda, player);
Expand Down
17 changes: 17 additions & 0 deletions EssentialsDiscord/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,23 @@ show-avatar: false
# To include the name of the player in this URL, use "{name}".
avatar-url: "https://crafthead.net/helm/{uuid}"

# When set to false, the message will send as the bot user instead of the player webhook.
send-types-as-player:
# Join messages sent when a player joins the Minecraft server.
join: true
# Join messages sent when a player joins the Minecraft server for the first time.
first-join: true
# Leave messages sent when a player leaves the Minecraft server.
leave: true
# Death messages sent when a player dies on the Minecraft server.
death: true
# AFK status change messages sent when a player's AFK status changes.
afk: true
# Achievement/advancement messages sent when a player is awarded an achievement/advancement.
advancement: true
# Action messages sent when a player runs the /me or /action commands.
action: true

# Whether or not fake join and leave messages should be sent to Discord when a player toggles vanish in Minecraft.
# Fake join/leave messages will be sent the same as real join and leave messages (and to the same channel).
vanish-fake-join-leave: true
Expand Down