Skip to content

Commit

Permalink
cleaned up unused variables, and added more logging
Browse files Browse the repository at this point in the history
- removed unused os.environ from react_roles since var isn't used
- added logging to uptime command
  • Loading branch information
seekheart committed Feb 18, 2024
1 parent bb42156 commit 49f9735
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 5 additions & 2 deletions jainy_bot/commands/uptime.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from datetime import datetime, timedelta
from discord.ext import commands
from loguru import logger


def _format_time(t: timedelta) -> str:
def format_time(t: timedelta) -> str:
logger.debug(f'Got timedelta = {t}')
h, m, s = str(t).split(':')
return f'{h} Hours {m} Minutes {s} Seconds'

Expand All @@ -15,5 +17,6 @@ def __init__(self, bot: commands):
@commands.command()
async def uptime(self, ctx: commands):
"""Get the uptime for bot"""
logger.info(f'Generating uptime information')
delta = datetime.now() - self.start_time
await ctx.send(f"Uptime: {_format_time(delta)}")
await ctx.send(f"Uptime: {format_time(delta)}")
6 changes: 0 additions & 6 deletions jainy_bot/react_roles.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import os
import discord

role_message_id = int(os.environ.get("ROLE_MESSAGE_ID"))
if not role_message_id:
raise AttributeError("ROLE_MESSAGE_ID not set!")


emoji_to_role = {
discord.PartialEmoji(name='🍖'): 1197959991315927101,
discord.PartialEmoji(name='🪦'): 800444883897942086,
Expand Down

0 comments on commit 49f9735

Please sign in to comment.