diff --git a/bot_discord.py b/bot_discord.py index c287b92..0671137 100644 --- a/bot_discord.py +++ b/bot_discord.py @@ -52,7 +52,9 @@ class DiscordBot(commands.Bot): async def on_command(self, ctx): """Logs every command execution at DEBUG level.""" - self.log(f"Discord Command executed: {ctx.command} by {ctx.author} in #{ctx.channel}: {ctx.message.content}", "DEBUG") + _cmd_args = str(ctx.message.content).split(" ")[1:] + self.log(f"Command '{ctx.command}' (Discord) initiated by {ctx.author} in #{ctx.channel}", "DEBUG") + if len(_cmd_args) > 1: self.log(f"!{ctx.command} arguments: {_cmd_args}", "DEBUG") async def on_ready(self): self.log(f"Discord bot is online as {self.user}", "INFO") diff --git a/bot_twitch.py b/bot_twitch.py index 0f8f258..bb7b173 100644 --- a/bot_twitch.py +++ b/bot_twitch.py @@ -48,8 +48,10 @@ class TwitchBot(commands.Bot): # Log the command if it's a command if message.content.startswith("!"): _cmd = message.content[1:] # Remove the leading "!" + _cmd_args = _cmd.split(" ")[1:] _cmd = _cmd.split(" ", 1)[0] - self.log(f"Twitch Command executed: {_cmd} by {message.author.name} in #{message.channel.name}: {message.content}", "DEBUG") + self.log(f"Command '{_cmd}' (Twitch) initiated by {message.author.name} in #{message.channel.name}", "DEBUG") + if len(_cmd_args) > 1: self.log(f"!{_cmd} arguments: {_cmd_args}", "DEBUG") # Process the message for command execution await self.handle_commands(message)