Add roleping list, closes #37
This commit is contained in:
parent
7774e6541b
commit
0706ee9232
1 changed files with 26 additions and 0 deletions
|
@ -952,6 +952,32 @@ class AdminCog(commands.Cog):
|
|||
)
|
||||
await ctx.send(f"Role `{role.name}` removed blocklist.")
|
||||
|
||||
@cog_ext.cog_subcommand(
|
||||
base="roleping",
|
||||
name="list",
|
||||
description="List all blocklisted roles",
|
||||
guild_ids=[418094694325813248, 578757004059738142, 862402786116763668],
|
||||
)
|
||||
async def _roleping_list(self, ctx: SlashContext):
|
||||
roles = self.db.jarvis.settings.find_one(
|
||||
{"guild": ctx.guild.id, "setting": "roleping"}
|
||||
)
|
||||
if not roles:
|
||||
await ctx.send("No blocklist configured.", hidden=True)
|
||||
return
|
||||
|
||||
message = "Blocklisted Roles:\n```\n"
|
||||
if not roles["value"]:
|
||||
await ctx.send("No roles blocklisted.", hidden=True)
|
||||
return
|
||||
for role in roles["value"]:
|
||||
role = ctx.guild.get_role(role)
|
||||
if not role:
|
||||
continue
|
||||
message += role.name + "\n"
|
||||
message += "```"
|
||||
await ctx.send(message)
|
||||
|
||||
@cog_ext.cog_subcommand(
|
||||
base="autopurge",
|
||||
name="add",
|
||||
|
|
Loading…
Add table
Reference in a new issue