import discord from discord.ext import commands from discord.utils import get async def setup(bot: commands.Bot): await bot.add_cog(AngelCommands(bot)) class AngelCommands(commands.Cog): """Administrative functionality.""" def __init__(self, bot: commands.Bot): self.bot = bot @commands.command( description="List ungreeted users", brief="Show a list of users that have not been granted the @fan role", help="Generates list of users not in the @fan role" ) @commands.has_guild_permissions(manage_roles=True) @commands.guild_only() async def ungreeted(self, interaction: discord.Interaction): if interaction.guild.id == 962355492850638939: # Only in the Angels guild. not_fanned = [] for member in interaction.guild.members: # For loop for each guild member. if not get(member.roles, id=962382104816140398): not_fanned.append(f"{member.mention}|{member.nick}") await interaction.send_message(content=not_fanned, ephemeral=True)