mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-12-28 17:37:52 +01:00
Tweak default uncached mention lookup and member caching
This commit is contained in:
parent
803eb9af3f
commit
189d8375cd
@ -33,7 +33,7 @@ public class MemberCachingConfig {
|
||||
|
||||
@Comment("If all members should be cached\n"
|
||||
+ "Requires the \"Server Members Intent\"")
|
||||
public boolean all = false;
|
||||
public boolean all = true;
|
||||
|
||||
@Comment("If members should be cached at startup\n"
|
||||
+ "Requires the \"Server Members Intent\"")
|
||||
|
@ -83,8 +83,9 @@ public class MinecraftToDiscordChatConfig implements IMessageConfig {
|
||||
public boolean users = true;
|
||||
|
||||
@Comment("If uncached users should be looked up from the Discord API when a mention (\"@something\") occurs in chat.\n"
|
||||
+ "The player needs the discordsrv.mention.lookup.user permission for uncached members to be looked up")
|
||||
public boolean uncachedUsers = true;
|
||||
+ "The player needs the discordsrv.mention.lookup.user permission for uncached members to be looked up\n"
|
||||
+ "This WILL cause sending messages to be delayed")
|
||||
public boolean uncachedUsers = false;
|
||||
|
||||
@Comment("If @everyone and @here mentions should be enabled\n"
|
||||
+ "The player needs the discordsrv.mention.everyone permission to render the mention and trigger a notification")
|
||||
|
@ -56,7 +56,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class MentionCachingModule extends AbstractModule<DiscordSRV> {
|
||||
|
||||
private static final Pattern USER_MENTION_PATTERN = Pattern.compile("@[a-z0-9_.]{2,32}");
|
||||
private static final Pattern USER_MENTION_PATTERN = Pattern.compile("(?<!<)@[a-z0-9_.]{2,32}");
|
||||
|
||||
private final Map<Long, Map<Long, CachedMention>> memberMentions = new ConcurrentHashMap<>();
|
||||
private final Map<Long, Cache<String, CachedMention>> memberMentionsCache = new ConcurrentHashMap<>();
|
||||
|
Loading…
Reference in New Issue
Block a user