Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General refactor #170

Merged
merged 3 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading