🐛 Fixed logging bug

Fixed the bug where logging a command doesn't log the subcommand group
This commit is contained in:
NikolajDanger
2021-04-06 16:44:38 +02:00
parent a8a581d0d5
commit 37a899f497

View File

@ -12,8 +12,14 @@ class EventHandler():
subcommand = f" {ctx.subcommand_name} " subcommand = f" {ctx.subcommand_name} "
else: else:
subcommand = " " subcommand = " "
if ctx.subcommand_group is not None:
subcommandGroup = f"{ctx.subcommand_group} "
else:
subcommandGroup = ""
args = " ".join([str(i) for i in ctx.args]) args = " ".join([str(i) for i in ctx.args])
fullCommand = f"/{ctx.command}{subcommand}{args}" fullCommand = f"/{ctx.command}{subcommand}{subcommandGroup}{args}"
logMessage = f"{ctx.author.display_name} ran {fullCommand}" logMessage = f"{ctx.author.display_name} ran {fullCommand}"
self.bot.log(logMessage, str(ctx.channel_id), level = 25) self.bot.log(logMessage, str(ctx.channel_id), level = 25)