vertyco / vrt-cogs

Utility cogs for Red by Vertyco
MIT License
48 stars 28 forks source link

[Tickets] [p]renameticket and /renameticket cannot be used together in a single ticket. #155

Closed Skyridr closed 10 months ago

Skyridr commented 10 months ago

It appears you can't use both prefix and slash command in a single thread. If you use one, the other will no longer work. If you attempt to do so, both prefix and slash will break. Not sure if this applies to channels as well, only using threads.

image

And here slash and prefix after:

image

In both images, the last command didn't work anymore.

Also, side bug I guess? The bot is thinking forever after using the rename slash command.

Some extra: After I closed one of the test threads, after a little bit I received this traceback:

Exception in command 'renameticket':

Traceback (most recent call last):
  File "{HOME}/koala/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{HOME}/koala/cogs/CogManager/cogs/tickets/commands/base.py", line 96, in rename_ticket
    await ctx.channel.edit(name=new_name)
  File "{HOME}/koala/lib/python3.11/site-packages/discord/threads.py", line 655, in edit
    data = await self._state.http.edit_channel(self.id, **payload, reason=reason)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{HOME}/koala/lib/python3.11/site-packages/discord/http.py", line 745, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50083): Thread is archived

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "{HOME}/koala/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "{HOME}/koala/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "{HOME}/koala/lib/python3.11/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 50083): Thread is archived

Seems after some time (10 minutes apparently), it attempted to rename an archived thread. I think? It was the prefix command that attempted to do this after a long delay.

vertyco commented 10 months ago

@Skyridr update and try now, the handling of the rename should be a little more robust now

vertyco commented 10 months ago

closing this for no response