import discord from discord.ext import commands from discord.utils import get async def setup(bot: commands.Bot): await bot.add_cog(AngelCommands(bot)) def check_if_home_guild(interaction): return interaction.guild.id == 962355492850638939 class AngelCommands(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot @discord.app_commands.command( name="ungreeted", description="List ungreeted users", ) @commands.has_guild_permissions(manage_roles=True) @commands.check(check_if_home_guild) async def ungreeted(self, interaction: discord.Interaction): not_fanned = [] for member in interaction.guild.members: # For loop for each guild member. if not get(member.roles, id=962382104816140398) and not member.bot: not_fanned.append(f"{member.mention} | {member.name}") await interaction.response.send_message(content=not_fanned)