diff options
| author | 2020-07-01 01:36:25 +0000 | |
|---|---|---|
| committer | 2020-07-01 01:36:25 +0000 | |
| commit | 18dace4da6868f0a8aa6c64728994c68695fed95 (patch) | |
| tree | 6c05d10ea45cb10e9d3d25242732a74f23ff9a3e | |
| parent | Create docstring for Slowmode cog (diff) | |
Add some logging for the Slowmode cog
| -rw-r--r-- | bot/cogs/slowmode.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bot/cogs/slowmode.py b/bot/cogs/slowmode.py index a650ac395..7bbd61623 100644 --- a/bot/cogs/slowmode.py +++ b/bot/cogs/slowmode.py @@ -1,3 +1,5 @@ +import logging + from discord import TextChannel from discord.ext.commands import Cog, Context, group @@ -5,6 +7,8 @@ from bot.bot import Bot from bot.constants import Emojis, MODERATION_ROLES from bot.decorators import with_role +log = logging.getLogger(__name__) + class Slowmode(Cog): """Commands for getting and setting slowmode delays of text channels.""" @@ -33,10 +37,16 @@ class Slowmode(Cog): f'{Emojis.check_mark} The slowmode delay for {channel.mention} is now {seconds} seconds.' ) + log.info(f'{ctx.author} set the slowmode delay for #{channel} to {seconds} seconds.') + else: await ctx.send( f'{Emojis.cross_mark} The slowmode delay must be between 0 and 21600 seconds.' ) + log.info( + f'{ctx.author} tried to set the slowmode delay of #{channel} to {seconds} seconds, ' + 'which is not between 0 and 21600 seconds.' + ) @slowmode_group.command(name='reset', aliases=['r']) @with_role(*MODERATION_ROLES) @@ -46,6 +56,7 @@ class Slowmode(Cog): await ctx.send( f'{Emojis.check_mark} The slowmode delay for {channel.mention} has been reset to 0 seconds.' ) + log.info(f'{ctx.author} reset the slowmode delay for #{channel} to 0 seconds.') def setup(bot: Bot) -> None: |