fix(forums): fixed a typerror
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Seaswimmer 2023-09-01 22:04:59 -04:00
parent 4f9a1c9f4e
commit a90fc5b878
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -96,17 +96,17 @@ class Forums(commands.Cog):
await ctx.send("Please provide a valid role that exists in the request roles list.") await ctx.send("Please provide a valid role that exists in the request roles list.")
# Function to create select options # Function to create select options
def create_select_options(self, data): def create_select_options(self, ctx: commands.Context, data):
options = [] options = []
for tag in data: for tag in data:
emoji = tag.emoji.id if tag.emoji.id else str(tag.emoji.name) emoji = ctx.guild.get_emoji(tag.emoji.id) if tag.emoji.id else str(tag.emoji.name)
options.append(discord.SelectOption(label=tag.name, emoji=emoji, description="")) options.append(discord.SelectOption(label=tag.name, emoji=emoji, description=""))
return options return options
@forumsconfig.command() @forumsconfig.command()
async def forumsconfig_tag_set(self, ctx, channel: discord.ForumChannel): async def forumsconfig_tag_set(self, ctx, channel: discord.ForumChannel):
# Create select options from the proxy data # Create select options from the proxy data
options = self.create_select_options(channel.available_tags) options = self.create_select_options(ctx, channel.available_tags)
await ctx.send("Menus!", view=SelectView(options)) await ctx.send("Menus!", view=SelectView(options))