1
0

angels.py 966 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. class AngelCommands(commands.Cog):
  7. """Administrative functionality."""
  8. def __init__(self, bot: commands.Bot):
  9. self.bot = bot
  10. @commands.command(
  11. description="List ungreeted users",
  12. brief="Show a list of users that have not been granted the @fan role",
  13. help="Generates list of users not in the @fan role"
  14. )
  15. @commands.has_guild_permissions(manage_roles=True)
  16. @commands.guild_only()
  17. async def ungreeted(self, interaction: discord.Interaction):
  18. if interaction.guild.id == 962355492850638939: # Only in the Angels guild.
  19. not_fanned = []
  20. for member in interaction.guild.members: # For loop for each guild member.
  21. if not get(member.roles, id=962382104816140398):
  22. not_fanned.append(f"{member.mention}|{member.nick}")
  23. await interaction.send_message(content=not_fanned, ephemeral=True)