1
0

angels.py 870 B

123456789101112131415161718192021222324252627
  1. import discord
  2. from discord.ext import commands
  3. from discord.utils import get
  4. async def setup(bot: commands.Bot):
  5. await bot.add_cog(AngelCommands(bot))
  6. def check_if_home_guild(interaction):
  7. return interaction.guild.id == 962355492850638939
  8. class AngelCommands(commands.Cog):
  9. def __init__(self, bot: commands.Bot):
  10. self.bot = bot
  11. @discord.app_commands.command(
  12. name="ungreeted",
  13. description="List ungreeted users",
  14. )
  15. @commands.has_guild_permissions(manage_roles=True)
  16. @commands.check(check_if_home_guild)
  17. async def ungreeted(self, interaction: discord.Interaction):
  18. not_fanned = []
  19. for member in interaction.guild.members: # For loop for each guild member.
  20. if not get(member.roles, id=962382104816140398) and not member.bot:
  21. not_fanned.append(f"{member.mention} | {member.name}")
  22. await interaction.response.send_message(content=not_fanned)