feat: Introduce admin webhook and enhanced reload commands with redeploy functionality, implement post-restart notifications, and update Docker container names from Kyoko to Aurora.
This commit is contained in:
@@ -8,6 +8,29 @@ const event: Event<Events.ClientReady> = {
|
||||
execute: async (c) => {
|
||||
console.log(`Ready! Logged in as ${c.user.tag}`);
|
||||
schedulerService.start();
|
||||
|
||||
// Check for restart context
|
||||
const { readFile, unlink } = await import("fs/promises");
|
||||
const { createSuccessEmbed } = await import("@lib/embeds");
|
||||
|
||||
try {
|
||||
const contextData = await readFile(".restart_context.json", "utf-8");
|
||||
const context = JSON.parse(contextData);
|
||||
|
||||
// Validate context freshness (e.g., ignore if older than 5 minutes)
|
||||
if (Date.now() - context.timestamp < 5 * 60 * 1000) {
|
||||
const channel = await c.channels.fetch(context.channelId);
|
||||
if (channel && channel.isSendable()) {
|
||||
await channel.send({
|
||||
embeds: [createSuccessEmbed("Bot is back online! Redeploy successful.", "System Online")]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await unlink(".restart_context.json");
|
||||
} catch (error) {
|
||||
// Ignore errors (file not found, etc.)
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user