mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
fix case generation for cases which were not logged to modlog channel (#2477)
Add documentation for failure cases Prevent an expected failure case.
This commit is contained in:
parent
9966668307
commit
619c3f28f7
@ -237,9 +237,21 @@ class Case:
|
||||
Case
|
||||
The case object for the requested case
|
||||
|
||||
Raises
|
||||
------
|
||||
`discord.NotFound`
|
||||
The user the case is for no longer exists
|
||||
`discord.Forbidden`
|
||||
Cannot read message history to fetch the original message.
|
||||
`discord.HTTPException`
|
||||
A generic API issue
|
||||
"""
|
||||
guild = mod_channel.guild
|
||||
if data["message"]:
|
||||
try:
|
||||
message = await mod_channel.get_message(data["message"])
|
||||
except discord.NotFound:
|
||||
message = None
|
||||
user = await bot.get_user_info(data["user"])
|
||||
moderator = guild.get_member(data["moderator"])
|
||||
channel = guild.get_channel(data["channel"])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user