mirror of https://github.com/stijndcl/didier
Move command logging to on_command
parent
c897cebcd5
commit
08b5742830
|
@ -66,16 +66,8 @@ class Events(commands.Cog):
|
||||||
if not checks.freeGamesCheck(message):
|
if not checks.freeGamesCheck(message):
|
||||||
await self.failedChecksCog.freeGames(message)
|
await self.failedChecksCog.freeGames(message)
|
||||||
|
|
||||||
# Log commands in terminal
|
|
||||||
# TODO move to on_command
|
|
||||||
# if any(message.content.lower().startswith(pre) for pre in self.client.prefixes):
|
|
||||||
# DM = message.guild is None
|
|
||||||
# print("{} in {}: {}".format(message.author.display_name,
|
|
||||||
# "DM" if DM else "{} ({})".format(message.channel.name, message.guild.name),
|
|
||||||
# message.content))
|
|
||||||
|
|
||||||
# Boos React to people that call him Dider
|
# Boos React to people that call him Dider
|
||||||
if "dider" in message.content.lower() and str(message.author.id) not in [constants.myId, constants.didierId]:
|
if "dider" in message.content.lower() and str(message.author.id) not in [constants.myId, constants.didierId, constants.coolerDidierId]:
|
||||||
await message.add_reaction("<:boos:629603785840263179>")
|
await message.add_reaction("<:boos:629603785840263179>")
|
||||||
|
|
||||||
# Check for other easter eggs
|
# Check for other easter eggs
|
||||||
|
@ -86,6 +78,18 @@ class Events(commands.Cog):
|
||||||
# Earn XP & Message count
|
# Earn XP & Message count
|
||||||
stats.sentMessage(message)
|
stats.sentMessage(message)
|
||||||
|
|
||||||
|
@commands.Cog.listener()
|
||||||
|
async def on_command(self, ctx):
|
||||||
|
"""
|
||||||
|
Function called whenever someone invokes a command.
|
||||||
|
Logs commands in your terminal.
|
||||||
|
:param ctx: Discord Context
|
||||||
|
"""
|
||||||
|
DM = ctx.guild is None
|
||||||
|
print("{} in {}: {}".format(ctx.author.display_name,
|
||||||
|
"DM" if DM else "{} ({})".format(ctx.channel.name, ctx.guild.name),
|
||||||
|
ctx.message.content))
|
||||||
|
|
||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_command_error(self, ctx, err):
|
async def on_command_error(self, ctx, err):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue