diff options
author | 2019-03-18 21:37:11 -0700 | |
---|---|---|
committer | 2019-03-18 21:57:37 -0700 | |
commit | f0541bdb67ff8fb9c4b8028c23d6870d011847ed (patch) | |
tree | 05a63f0db619dcb4643c8fb6d18abf618d7edd41 /bot/bot.py | |
parent | Add constants.py to linting exclusion (diff) |
Docstring pass for top-level bot functions
Diffstat (limited to 'bot/bot.py')
-rw-r--r-- | bot/bot.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -16,6 +16,8 @@ __all__ = ('SeasonalBot',) class SeasonalBot(Bot): + """Base bot instance.""" + def __init__(self, **kwargs): super().__init__(**kwargs) self.http_session = ClientSession( @@ -26,9 +28,7 @@ class SeasonalBot(Bot): ) def load_extensions(self, exts: List[str]): - """ - Unload all current cogs, then load in the ones passed into `cogs` - """ + """Unload all current cogs, then load in the ones passed into `cogs`.""" # Unload all cogs extensions = list(self.extensions.keys()) @@ -46,9 +46,8 @@ class SeasonalBot(Bot): log.error(f'Failed to load extension {cog}: {repr(e)} {format_exc()}') async def send_log(self, title: str, details: str = None, *, icon: str = None): - """ - Send an embed message to the devlog channel - """ + """Send an embed message to the devlog channel.""" + devlog = self.get_channel(constants.Channels.devlog) if not devlog: @@ -64,7 +63,8 @@ class SeasonalBot(Bot): await devlog.send(embed=embed) async def on_command_error(self, context, exception): - # Don't punish the user for getting the arguments wrong + """Check command errors for UserInputError and reset the cooldown if thrown.""" + if isinstance(exception, commands.UserInputError): context.command.reset_cooldown(context) else: |