Returned the on_ready print and made it send out a message to all log channels

This commit is contained in:
Entarno54 2025-05-12 19:08:16 +07:00
parent 3f5ce3f777
commit a8950e1c54

View File

@ -4,7 +4,7 @@ from nextcord.ext import commands
from userinfo import parsedinfo from userinfo import parsedinfo
class Logger(commands.Cog): class Logger(commands.Cog):
def __init__(self, bot): def __init__(self, bot: commands.Bot):
self.mod = None self.mod = None
self.client = bot self.client = bot
@ -43,5 +43,12 @@ class Logger(commands.Cog):
channel = ctx.guild.get_channel(guild["log-channel"]) channel = ctx.guild.get_channel(guild["log-channel"])
await channel.send(embed=embed) await channel.send(embed=embed)
@commands.Cog.listener()
async def on_ready(self):
print(f"Bot ready as {self.client.user.name}")
for guild in parsedinfo.parsed["guild"]:
if guild["log-channel"] != 1:
await self.client.get_channel(guild["log-channel"]).send("SquogBot instance loaded!")
def setup(bot): def setup(bot):
bot.add_cog(Logger(bot)) bot.add_cog(Logger(bot))