fix(bot): 🚑 Use default asyncio loop instead of uvloop.

This commit is contained in:
Nyeki.py
2024-10-26 00:27:51 -03:00
parent d3ee4cc576
commit aa445fbf63
3 changed files with 11 additions and 11 deletions
+8
View File
@@ -69,6 +69,12 @@ class Payphone(commands.AutoShardedBot):
owner_ids=[898569996949676052, 777338793803513886],
)
@tasks.loop(seconds=5)
async def update_heartbeat(self) -> None:
"""Updates the heartbeat timestamp."""
self.heartbeat.value = int(datetime.now(timezone.utc).timestamp())
async def on_ready(self) -> None:
"""Initializes the bot.
@@ -80,6 +86,8 @@ class Payphone(commands.AutoShardedBot):
await self.redis.ping()
self.update_heartbeat.start()
print(f"Ready! Logged in as {self.user.display_name}.")
async def on_shard_ready(self, shard_id: int) -> None:
-11
View File
@@ -12,17 +12,6 @@ class Utility(base.Cog):
def __init__(self, bot_instance: bot.Payphone):
self.bot = bot_instance
self.update_heartbeat.start()
def cog_unload(self) -> None:
self.update_heartbeat.cancel()
@tasks.loop(seconds=5)
async def update_heartbeat(self) -> None:
"""Updates the heartbeat timestamp."""
self.bot.heartbeat.value = int(datetime.now(timezone.utc).timestamp())
@commands.command()
@commands.cooldown(1, 60, commands.BucketType.user)
@checks.is_unbanned()