mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Modlog] Fix get_case for missing cases (#2858)
Due to the modlog redesign, the detection for a missing case changed. This fixes `get_case` for this. This resolves #2844.
This commit is contained in:
parent
03e0683dd7
commit
21a6384ebf
@ -514,10 +514,10 @@ async def get_case(case_number: int, guild: discord.Guild, bot: Red) -> Case:
|
||||
If there is no case for the specified number
|
||||
|
||||
"""
|
||||
try:
|
||||
case = await _conf.custom(_CASES, str(guild.id), str(case_number)).all()
|
||||
except KeyError as e:
|
||||
raise RuntimeError("That case does not exist for guild {}".format(guild.name)) from e
|
||||
|
||||
case = await _conf.custom(_CASES, str(guild.id), str(case_number)).all()
|
||||
if not case["case_number"]:
|
||||
raise RuntimeError("That case does not exist for guild {}".format(guild.name))
|
||||
mod_channel = await get_modlog_channel(guild)
|
||||
return await Case.from_json(mod_channel, bot, case_number, case)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user