Skip to content

Commit

Permalink
[Info] suppress error
Browse files Browse the repository at this point in the history
  • Loading branch information
japandotorg committed Jul 16, 2024
1 parent a2bec6d commit d299e77
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions info/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ async def cog_unload(self) -> None:
log.exception(
"Something went wrong removing the `userinfo` command.", exc_info=error
)
with contextlib.suppress(TypeError):
self.bot.add_command(OLD_USERINFO_COMMAND)
self.bot.add_command(OLD_USERINFO_COMMAND)
if (command := OLD_CINFO_COMMAND) is not discord.utils.MISSING:
if not ("cinfo" in (aliases := list(command.aliases)) and "cinfo" == command.name):
aliases.append("cinfo")
Expand Down Expand Up @@ -215,7 +214,8 @@ async def setup(bot: Red) -> None:
if Mod.__name__ not in bot.cogs:
raise CogLoadError("The Mod cog is required to be loaded to use this cog.")
global OLD_USERINFO_COMMAND
OLD_USERINFO_COMMAND = cast(commands.Command, bot.remove_command("userinfo"))
with contextlib.suppress(TypeError):
OLD_USERINFO_COMMAND = cast(commands.Command, bot.remove_command("userinfo"))
if command := bot.get_command("cinfo"):
global OLD_CINFO_COMMAND
OLD_CINFO_COMMAND = cast(commands.Command, command)
Expand Down

0 comments on commit d299e77

Please sign in to comment.