mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
Fix how attachment placeholder gets the delimiter
This commit is contained in:
parent
c7466202b9
commit
5d63417fbb
@ -39,7 +39,7 @@ public class DiscordToMinecraftChatConfig {
|
|||||||
|
|
||||||
@Comment("The Discord to Minecraft message format for webhook messages (if enabled)")
|
@Comment("The Discord to Minecraft message format for webhook messages (if enabled)")
|
||||||
@Untranslated(Untranslated.Type.VALUE)
|
@Untranslated(Untranslated.Type.VALUE)
|
||||||
public String webhookFormat = "[ᛩF2Discord&r] [hover:show_text:Webhook message]%user_name%&r » %message%%message_attachments_ %";
|
public String webhookFormat = "[ᛩF2Discord&r] [hover:show_text:Webhook message]%user_name%&r » %message%%message_attachments:' '%";
|
||||||
|
|
||||||
@Comment("Attachment format")
|
@Comment("Attachment format")
|
||||||
@Untranslated(Untranslated.Type.VALUE)
|
@Untranslated(Untranslated.Type.VALUE)
|
||||||
|
@ -324,11 +324,14 @@ public class ReceivedDiscordMessageImpl implements ReceivedDiscordMessage {
|
|||||||
|
|
||||||
@Placeholder("message_attachments")
|
@Placeholder("message_attachments")
|
||||||
public Component _attachments(BaseChannelConfig config, @PlaceholderRemainder String suffix) {
|
public Component _attachments(BaseChannelConfig config, @PlaceholderRemainder String suffix) {
|
||||||
if (suffix.startsWith("_")) {
|
if (suffix.startsWith(":")) {
|
||||||
suffix = suffix.substring(1);
|
suffix = suffix.substring(1);
|
||||||
} else if (!suffix.isEmpty()) {
|
} else if (!suffix.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (suffix.startsWith("'") && suffix.endsWith("'")) {
|
||||||
|
suffix = suffix.substring(1, suffix.length() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
String attachmentFormat = config.discordToMinecraft.attachmentFormat;
|
String attachmentFormat = config.discordToMinecraft.attachmentFormat;
|
||||||
List<Component> components = new ArrayList<>();
|
List<Component> components = new ArrayList<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user