diff options
| author | 2019-03-30 10:40:38 -0400 | |
|---|---|---|
| committer | 2019-03-30 10:42:02 -0400 | |
| commit | 095dc1791f147682023edafc59abdc4019074eeb (patch) | |
| tree | 160d7ee160042befbfba778e54507a5eee3bd686 /bot/seasons/evergreen/uptime.py | |
| parent | Merge branch 'master' into hotfix (diff) | |
| parent | Merge pull request #146 from python-discord/flake8-docstring (diff) | |
Merge branch 'master' into hotfix
Diffstat (limited to 'bot/seasons/evergreen/uptime.py')
| -rw-r--r-- | bot/seasons/evergreen/uptime.py | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/bot/seasons/evergreen/uptime.py b/bot/seasons/evergreen/uptime.py index 3d2c7d03..4d5ac584 100644 --- a/bot/seasons/evergreen/uptime.py +++ b/bot/seasons/evergreen/uptime.py @@ -9,19 +9,16 @@ from bot import start_time  log = logging.getLogger(__name__) -class Uptime(commands.Cog): -    """ -    A cog for posting the bots uptime. -    """ +class Uptime: +    """A cog for posting the bot's uptime."""      def __init__(self, bot):          self.bot = bot      @commands.command(name="uptime")      async def uptime(self, ctx): -        """ -        Returns the uptime of the bot. -        """ +        """Responds with the uptime of the bot.""" +          difference = relativedelta(start_time - arrow.utcnow())          uptime_string = start_time.shift(              seconds=-difference.seconds, @@ -32,7 +29,8 @@ class Uptime(commands.Cog):          await ctx.send(f"I started up {uptime_string}.") -# Required in order to load the cog, use the class name in the add_cog function.  def setup(bot): +    """Uptime Cog load.""" +      bot.add_cog(Uptime(bot))      log.info("Uptime cog loaded") | 
