mirror of
https://github.com/polyjitter/searchbot-discord.git
synced 2024-08-14 22:46:55 +00:00
made none mean dms in logging
This commit is contained in:
parent
47ea949d52
commit
1db31f55a9
2 changed files with 11 additions and 3 deletions
|
@ -53,7 +53,7 @@ class BetterLogging(commands.Cog):
|
||||||
|
|
||||||
msg = (
|
msg = (
|
||||||
f"**`{ctx.command.name}`** called by "
|
f"**`{ctx.command.name}`** called by "
|
||||||
f"**{ctx.author}** in _\"{ctx.guild}\"_."
|
f"**{ctx.author}** in _\"{ctx.guild if ctx.guild else 'DMs'}\"_."
|
||||||
)
|
)
|
||||||
|
|
||||||
await self.info(content=msg, name="Command Call")
|
await self.info(content=msg, name="Command Call")
|
||||||
|
|
12
main.py
12
main.py
|
@ -198,14 +198,22 @@ async def on_command_error(ctx, error):
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
embed_fallback = f"**An error occured: {type(error).__name__}. Please contact {bot.appinfo.owner}.**"
|
embed_fallback = f"**An error occured: {type(error).__name__}. Please contact {bot.appinfo.owner}.**"
|
||||||
error_embed = await bot.logging.error(error, ctx, ctx.command.cog.qualified_name)
|
error_embed = await bot.logging.error(
|
||||||
|
error, ctx,
|
||||||
|
ctx.command.cog.qualified_name if ctx.command.cog.qualified_name
|
||||||
|
else "DMs"
|
||||||
|
)
|
||||||
|
|
||||||
# Sending
|
# Sending
|
||||||
await ctx.send(embed_fallback, embed=error_embed)
|
await ctx.send(embed_fallback, embed=error_embed)
|
||||||
|
|
||||||
# If anything else goes wrong, just go ahead and send it in chat.
|
# If anything else goes wrong, just go ahead and send it in chat.
|
||||||
else:
|
else:
|
||||||
await bot.logging.error(error, ctx, ctx.command.cog.qualified_name)
|
await bot.logging.error(
|
||||||
|
error, ctx,
|
||||||
|
ctx.command.cog.qualified_name if ctx.command.cog.qualified_name
|
||||||
|
else "DMs"
|
||||||
|
)
|
||||||
await ctx.send(error)
|
await ctx.send(error)
|
||||||
# NOTE Bot Entry Point
|
# NOTE Bot Entry Point
|
||||||
# Starts the bot
|
# Starts the bot
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue