misc(forums): removed role viewing functionality from resolvedset role, use resolvedset show
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Seaswimmer 2023-09-08 13:59:35 -04:00
parent c498bdce05
commit f5d0faa8f2
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -132,21 +132,9 @@ class Forums(commands.Cog):
embed = discord.Embed(title="Cog Settings", color=await self.bot.get_embed_color(None), description=channel + tag_str + roles_list) embed = discord.Embed(title="Cog Settings", color=await self.bot.get_embed_color(None), description=channel + tag_str + roles_list)
await ctx.reply(embed=embed) await ctx.reply(embed=embed)
@resolvedset.group(name='role', invoke_without_command=True, aliases=['roles']) @resolvedset.group(name='role', autohelp=True, aliases=['roles'])
async def resolvedset_role(self, ctx: commands.Context): async def resolvedset_role(self, ctx: commands.Context):
"""Manages the allowed roles list.""" """Manages the allowed roles list."""
current_list = await self.config.guild(ctx.guild).request_roles()
already_in_list = []
for role_id in current_list:
role_obj = ctx.guild.get_role(role_id)
if role_obj:
already_in_list.append(role_obj.mention)
split_content = ctx.message.content.split()
command = ' '.join(split_content[:2])
if already_in_list:
await ctx.send("Roles already in the allowed roles list:\n" + "\n".join(already_in_list) + f"\nUse `{command} add` to add roles to this list.\nUse `{command} remove` to remove roles from this list.", allowed_mentions=discord.AllowedMentions(roles=False))
else:
await ctx.send(f"No roles are currently in the allowed roles list.\nUse `{command} add` to add some!")
@resolvedset_role.command(name='add') @resolvedset_role.command(name='add')
async def resolvedset_role_add(self, ctx: commands.Context, role: discord.Role = None): async def resolvedset_role_add(self, ctx: commands.Context, role: discord.Role = None):