Skip to content

Commit

Permalink
fix is_in_group
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 12, 2023
1 parent 8d42379 commit 1139a7e
Showing 1 changed file with 2 additions and 5 deletions.
Expand Up @@ -203,16 +203,13 @@ public static void register() {
// If this returns false, some usages of the object may still be valid.
// It may return false due to caching issues or because the user doesn't share a guild with the bot.
// -->
tagProcessor.registerTag(ElementTag.class, DiscordGroupTag.class, "is_valid", (attribute, object, group) -> {
tagProcessor.registerTag(ElementTag.class, DiscordGroupTag.class, "is_in_group", (attribute, object, group) -> {
if (object.getUser() == null) {
return new ElementTag(false);
}
group = new DiscordGroupTag(object.bot, group.guild_id);
Member member = group.getGuild().getMember(object.getUser());
if (member == null) {
return new ElementTag(false);
}
return new ElementTag(true);
return new ElementTag(member != null);
});

// <--[tag]
Expand Down

0 comments on commit 1139a7e

Please sign in to comment.