#Bot is unable to edit channel attributes

1 messages · Page 1 of 1 (latest)

fierce vessel
#

The following code snippet doesn't work. It doesn't update the channel description. It doesn't even give an error.

            try:
                await channel.edit(topic=str(channel_description))
            except Exception as e:
                print(e)
#

When I change the channel description the first time, it works

#

but when i do it a second time it doesn't work

#

The entire command is

async def add_milestone(ctx, name):
    if not name:
        member = bot.guild.get_member(int(ctx.channel.topic.split("|")[0]))
        name = await name_grabber(member)

    class MilestoneTypeSelect(discord.ui.Select):
        def __init__(self):
            super().__init__()
            for key, value in milestone_emojis.items():
                self.add_option(label=key, emoji=f"{value}")

        # Override default callback
        async def callback(self, interaction: discord.Interaction):
            # Set option var and delete Select so it cannot be used twice
            option = list(interaction.data.values())[0][0]
            option_emoji = milestone_emojis.get(option)
            channel = ctx.channel

            await interaction.response.send_message(f"**Milestone Category:** {option}"
                                                    f"\n**What is {name}'s milestone?**\n"
                                                    f"{option_emoji}{name}.... (Complete the sentence)")
            milestone = await bot.wait_for("message",
                                           check=lambda
                                               x: x.channel == channel and x.author == interaction.user)
            milestone_message = f"{option_emoji} {member.mention} {milestone.content}|"
            channel_description = channel.topic + milestone_message
            try:
                await channel.edit(topic=str(channel_description))
            except Exception as e:
                print(e)
            embed = discord.Embed(title="Milestone Registered!",
                                  description=milestone_message[:-1], color=neutral_color)

            await ctx.send(embed=embed)

arctic elm
#

Do you get any error?

fierce vessel
#

No error at all

arctic elm
#

So doesn't work at the second time

fierce vessel
#

Yeah

#

It doesn't

arctic elm
#

That's weird

fierce vessel
#

This just happened. This is from a different channel where I was messing around.

#

8 minutes to edit a channel topic?

fierce vessel
#

.

nova oyster
#

e.g. editing the name is like 2 per 10 mins