mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-22 11:55:54 +01:00
Change mentioning to usernames, add insert to mention to default Discord to Minecraft configuration
This commit is contained in:
parent
a28a55c9f0
commit
023d5d41d5
@ -35,7 +35,7 @@ public class DiscordToMinecraftChatConfig {
|
||||
public boolean enabled = true;
|
||||
|
||||
@Comment("The Discord to Minecraft message format for regular users and bots")
|
||||
public String format = "[[color:#5865F2]Discord[color]] [hover:show_text:Username: @%user_tag%\nRoles: %user_roles:', '|text:'[color:gray][italics:on]None[color][italics]'%]%user_color%%user_effective_server_name%[color][hover]%message_reply% » %message%%message_attachments%";
|
||||
public String format = "[[color:#5865F2]Discord[color]] [hover:show_text:Username: @%user_tag% [italics:on](Shift+Click to mention)[italics:off]\nRoles: %user_roles:', '|text:'[color:gray][italics:on]None[color][italics]'%][insert:@%user_tag%]%user_color%%user_effective_server_name%[color][hover]%message_reply% » %message%%message_attachments%";
|
||||
|
||||
@Comment("The Discord to Minecraft message format for webhook messages (if enabled)")
|
||||
public String webhookFormat = "[[color:#5865F2]Discord[color]] [hover:show_text:Bot message]%user_effective_name%[hover] » %message%%message_attachments%";
|
||||
|
@ -28,6 +28,7 @@ import com.github.benmanes.caffeine.cache.Cache;
|
||||
import net.dv8tion.jda.api.entities.Guild;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Role;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.Category;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.GuildChannel;
|
||||
import net.dv8tion.jda.api.events.channel.ChannelCreateEvent;
|
||||
import net.dv8tion.jda.api.events.channel.ChannelDeleteEvent;
|
||||
@ -149,7 +150,7 @@ public class MentionCachingModule extends AbstractModule<DiscordSRV> {
|
||||
|
||||
private CachedMention convertMember(Member member) {
|
||||
return new CachedMention(
|
||||
"@" + member.getEffectiveName(),
|
||||
"@" + member.getUser().getName(),
|
||||
member.getAsMention(),
|
||||
member.getIdLong()
|
||||
);
|
||||
@ -230,6 +231,11 @@ public class MentionCachingModule extends AbstractModule<DiscordSRV> {
|
||||
return channelMentions.computeIfAbsent(guild.getIdLong(), key -> {
|
||||
Map<Long, CachedMention> mentions = new LinkedHashMap<>();
|
||||
for (GuildChannel channel : guild.getChannels()) {
|
||||
if (channel instanceof Category) {
|
||||
// Not mentionable
|
||||
continue;
|
||||
}
|
||||
|
||||
mentions.put(channel.getIdLong(), convertChannel(channel));
|
||||
}
|
||||
return mentions;
|
||||
|
Loading…
Reference in New Issue
Block a user