Describe the bug
I believe it is from creating a forum channel, creating a parent post/message, then deleting it. After doing so, attempting to run def messages user on the target results in error. Could also effect threads but have not tested.
To Reproduce
Create forum channel
Make an initial post/message
Delete entire forum channel
Run def messages user against your userid
Expected behavior
A plaintext channel ID referencing the deleted forum/thread in the user messages log instead of an error.
Screenshots
Traceback (most recent call last):
File "/home/red/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 229, in wrapped
ret = await coro(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/red/.local/share/Red-DiscordBot/data/modet/cogs/CogManager/cogs/defender/commands/stafftools.py", line 98, in defmessagesgroupuser
pages = await self.make_message_log(user, guild=author.guild, requester=author, pagify_log=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/red/.local/share/Red-DiscordBot/data/modet/cogs/CogManager/cogs/defender/defender.py", line 204, in make_message_log
requester_can_rm = channel.permissions_for(requester).read_messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/red/redenv/lib/python3.11/site-packages/discord/threads.py", line 421, in permissions_for
raise ClientException('Parent channel not found')
discord.errors.ClientException: Parent channel not found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/red/redenv/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
await ctx.command.invoke(ctx)
File "/home/red/redenv/lib/python3.11/site-packages/redbot/core/commands/commands.py", line 783, in invoke
await super().invoke(ctx)
File "/home/red/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1642, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/red/redenv/lib/python3.11/site-packages/redbot/core/commands/commands.py", line 783, in invoke
await super().invoke(ctx)
File "/home/red/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1642, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/red/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1023, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/red/redenv/lib/python3.11/site-packages/discord/ext/commands/core.py", line 238, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: ClientException: Parent channel not found```
Can no longer replicate this issue. Seems to use the deleted channel ID rather than producing an error. Assumed fixed by updates either to defender or redbot itself.
Cog
Describe the bug I believe it is from creating a forum channel, creating a parent post/message, then deleting it. After doing so, attempting to run def messages user on the target results in error. Could also effect threads but have not tested.
To Reproduce
def messages user
against your useridExpected behavior A plaintext channel ID referencing the deleted forum/thread in the user messages log instead of an error.
Screenshots