From 8cecc0752c210c13369dfb3717bdfd5b8a97ca25 Mon Sep 17 00:00:00 2001 From: Steele Farnsworth Date: Fri, 26 Jan 2024 21:48:08 -0500 Subject: [PATCH] Add Spammer field to user info embed. If the command is evoked in a mod channel, the resultant embed will display whether the user in question has been flagged by Discord as a spammer. This commit also refactors how additional information is added to the embed in mod-only channels. --- bot/exts/info/information.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 8ef68bd9e3..3b20606c1f 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -292,9 +292,16 @@ async def create_user_embed(self, ctx: Context, user: MemberOrUser, passed_as_me # The 0 is for excluding the default @everyone role, # and the -1 is for reversing the order of the roles to highest to lowest in hierarchy. roles = ", ".join(role.mention for role in user.roles[:0:-1]) - membership = {"Joined": joined, "Verified": not user.pending, "Roles": roles or None} - if not is_mod_channel(ctx.channel): - membership.pop("Verified") + membership = { + "Joined": joined, + "Roles": roles or None, + } + + if is_mod_channel(ctx.channel): + membership.update({ + "Verified": not user.pending, + "Spammer": user.public_flags.spammer, + }) membership = textwrap.dedent("\n".join([f"{key}: {value}" for key, value in membership.items()])) else: