mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
Add discriminators back for users who still have them
This commit is contained in:
parent
e45e7c921c
commit
2f2b852b0d
@ -90,12 +90,17 @@ public interface DiscordUser extends JDAEntity<User>, Snowflake, Mentionable {
|
|||||||
String getEffectiveAvatarUrl();
|
String getEffectiveAvatarUrl();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Discord user's username followed by a {@code #} and their discriminator.
|
* Gets the Discord user's username, including discriminator if any.
|
||||||
* @return the Discord user's username and discriminator in the following format {@code Username#1234}
|
* @return the Discord user's username
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Placeholder("user_tag")
|
||||||
default String getAsTag() {
|
default String getAsTag() {
|
||||||
return getUsername() + "#" + getDiscriminator();
|
String username = getUsername();
|
||||||
|
String discriminator = getDiscriminator();
|
||||||
|
if (!discriminator.replace("0", "").isEmpty()) {
|
||||||
|
username = username + "#" + discriminator;
|
||||||
|
}
|
||||||
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,7 +34,7 @@ public class DiscordToMinecraftChatConfig {
|
|||||||
|
|
||||||
@Comment("The Discord to Minecraft message format for regular users and bots")
|
@Comment("The Discord to Minecraft message format for regular users and bots")
|
||||||
@Untranslated(Untranslated.Type.VALUE)
|
@Untranslated(Untranslated.Type.VALUE)
|
||||||
public String format = "[ᛩF2Discord&r] [hover:show_text:Username: @%user_name%&r\nRoles: %user_roles:', '|text:'&7&oNone'%]%user_color%%user_effective_server_name%&r%message_reply% » %message%%message_attachments%";
|
public String format = "[ᛩF2Discord&r] [hover:show_text:Username: @%user_tag%&r\nRoles: %user_roles:', '|text:'&7&oNone'%]%user_color%%user_effective_server_name%&r%message_reply% » %message%%message_attachments%";
|
||||||
|
|
||||||
@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)
|
||||||
@ -64,7 +64,7 @@ public class DiscordToMinecraftChatConfig {
|
|||||||
|
|
||||||
public Format role = new Format("ᛩf2@%role_name%", "ᛩf2@deleted-role");
|
public Format role = new Format("ᛩf2@%role_name%", "ᛩf2@deleted-role");
|
||||||
public Format channel = new Format("[hover:show_text:Click to go to channel][click:open_url:%channel_jump_url%]ᛩf2#%channel_name%", "ᛩf2#Unknown");
|
public Format channel = new Format("[hover:show_text:Click to go to channel][click:open_url:%channel_jump_url%]ᛩf2#%channel_name%", "ᛩf2#Unknown");
|
||||||
public Format user = new Format("[hover:show_text:Username: @%user_name%&r\nRoles: %user_roles:', '|text:'&7&oNone'%]ᛩf2@%user_effective_server_name|user_effective_name%", "ᛩf2@Unknown user");
|
public Format user = new Format("[hover:show_text:Username: @%user_tag%&r\nRoles: %user_roles:', '|text:'&7&oNone'%]ᛩf2@%user_effective_server_name|user_effective_name%", "ᛩf2@Unknown user");
|
||||||
|
|
||||||
public String messageUrl = "[hover:show_text:Click to go to message][click:open_url:%jump_url%]ᛩf2#%channel_name% > ...";
|
public String messageUrl = "[hover:show_text:Click to go to message][click:open_url:%jump_url%]ᛩf2#%channel_name% > ...";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user