Skip to content

Commit

Permalink
Merge pull request #170 from MiscGuild/general-refactor
Browse files Browse the repository at this point in the history
General refactor
  • Loading branch information
Amxgh authored Mar 17, 2024
2 parents 0488338 + 539093c commit fb2b883
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/cogs/menus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from discord.ext import commands, bridge

from src.func.Listener import Listener


Expand Down
10 changes: 5 additions & 5 deletions src/func/Integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from src.utils.db_utils import get_giveaway_status
from src.utils.discord_utils import name_grabber
from src.utils.giveaway_utils import roll_giveaway
from src.utils.request_utils import (get_guild_by_name, get_jpg_file)
from src.utils.request_utils import (get_guild_by_name)
from src.utils.ticket_utils.tickets import create_transcript


Expand Down Expand Up @@ -69,10 +69,10 @@ async def gtop(self, ctx):
text = f"**Daily Top: {date}**\n"
text = await generate_lb_text(member_gexp, text)

for x in range(5):
file = await get_jpg_file(f"https://fake-chat.matdoes.dev/render.png?m=custom&d={text}&t=1")
if file:
break
# for x in range(5):
# file = await get_jpg_file(f"https://fake-chat.matdoes.dev/render.png?m=custom&d={text}&t=1")
# if file:
# break
# Return image
# return file
return text
Expand Down
4 changes: 2 additions & 2 deletions src/utils/loop_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ async def before_giveaway_check():

@tasks.loop(hours=24)
async def send_gexp_lb():
await asyncio.sleep(1)
file = await Integer(integer=1).gtop(bot.get_channel(daily_lb_channel))
await bot.get_channel(daily_lb_channel).send(file)
if datetime.utcnow().weekday() == 0:
await bot.get_channel(weekly_lb_channel).send(
f"__Week {int(80 + round((datetime.utcnow() - datetime.strptime('14/08/2022', '%d/%m/%Y')).days / 7))}__\n"
f"**{(datetime.utcnow() - timedelta(days=7)).strftime('%d %b %Y')} "
f"-"
f" {datetime.utcnow().strftime('%d %B %Y')}**\n")
f" {datetime.utcnow().strftime('%d %B %Y')}**")
await bot.get_channel(weekly_lb_channel).send(await General.weeklylb(bot.get_channel(weekly_lb_channel)))


Expand Down Expand Up @@ -76,7 +77,6 @@ async def update_invites():
await generate_rank_upgrade(weekly_invitations)



@update_invites.before_loop
async def before_update_invites():
await bot.wait_until_ready()
Expand Down

0 comments on commit fb2b883

Please sign in to comment.