mirror of
https://github.com/Ryujinx/ryuko-ng.git
synced 2024-12-22 19:25:38 +00:00
Small set of hotfixes to make blocked_tids behave properly (#46)
* Revert log.exception() call to working state * Await add_roles call and invoke warn command correctly * Apply black formatting
This commit is contained in:
parent
5be9915501
commit
2506aa6437
|
@ -148,7 +148,7 @@ async def on_command_error(ctx: Context, error: CommandError):
|
|||
f"of type {type(error)}: {error_text}"
|
||||
)
|
||||
|
||||
log.exception(err_msg, error)
|
||||
log.exception(err_msg)
|
||||
|
||||
if not isinstance(error, commands.CommandNotFound):
|
||||
err_msg = bot.escape_message(err_msg)
|
||||
|
|
|
@ -722,13 +722,22 @@ class LogFileReader(Cog):
|
|||
pass
|
||||
|
||||
if is_tid_blocked():
|
||||
warn_message = await message.reply(
|
||||
f".warn This log contains a blocked title id."
|
||||
)
|
||||
await self.bot.invoke(await self.bot.get_context(warn_message))
|
||||
warn_command = self.bot.get_command("warn")
|
||||
if warn_command is not None:
|
||||
warn_message = await message.reply(
|
||||
".warn This log contains a blocked title id."
|
||||
)
|
||||
warn_context = await self.bot.get_context(warn_message)
|
||||
await warn_context.invoke(
|
||||
warn_command, reason="This log contains a blocked title id."
|
||||
)
|
||||
else:
|
||||
logging.error(
|
||||
f"Couldn't find 'warn' command. Unable to warn {message.author}."
|
||||
)
|
||||
|
||||
pirate_role = message.guild.get_role(self.bot.config.named_roles["pirate"])
|
||||
message.author.add_roles(pirate_role)
|
||||
await message.author.add_roles(pirate_role)
|
||||
|
||||
embed = Embed(
|
||||
title="⛔ Blocked game detected ⛔",
|
||||
|
|
Loading…
Reference in a new issue