diff --git a/commands/info.py b/commands/info.py index 5f97a7f..31b6601 100644 --- a/commands/info.py +++ b/commands/info.py @@ -12,25 +12,27 @@ plugin = lightbulb.Plugin("info", default_enabled_guilds=c.config["guild"]) # Get list of inactive members @plugin.command @lightbulb.add_checks(lightbulb.has_guild_permissions(hikari.Permissions.MANAGE_GUILD)) -@lightbulb.command("inactive", "List inactive members", ephemeral=True) +@lightbulb.command("limbo", "List members not in activity database", ephemeral=True) @lightbulb.implements(lightbulb.SlashCommand) -async def inactive(context): +async def limbo(context): def build(index, content): return hikari.Embed( - title="Inactive", description=content, color=context.get_guild().get_my_member().get_top_role().color - ).set_footer(f"{len(inactive)} members") + title="Limbo", description=content, color=context.get_guild().get_my_member().get_top_role().color + ).set_footer(f"{len(limbo)} members") - inactive = { + limbo = { snowflake: member for snowflake, member in sorted( context.get_guild().get_members().items(), key=lambda item: item[1].display_name ) - if snowflake not in c.db + if not member.is_bot + and c.config["exclude"] not in [role.id for role in member.get_roles()] + and snowflake not in c.db } paginator = lightbulb.utils.EmbedPaginator() paginator.set_embed_factory(build) - for snowflake, member in inactive.items(): + for snowflake, member in limbo.items(): paginator.add_line(f"{member.mention} {snowflake}") pages = [page for page in paginator.build_pages()]