feat(bot): add NodeJS implementation and deploy script
This commit is contained in:
31
src/events/ready.js
Normal file
31
src/events/ready.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const { Events } = require('discord.js');
|
||||
const logger = require('../utils/logger');
|
||||
const loadErelaEvents = require('../structures/ErelaEvents'); // Import the Erela event loader
|
||||
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
once: true, // This event should only run once
|
||||
execute(client) {
|
||||
logger.info(`Ready! Logged in as ${client.user.tag}`);
|
||||
|
||||
// Initialize the Erela Manager once the client is ready
|
||||
try {
|
||||
client.manager.init(client.user.id);
|
||||
logger.info(`Erela.js Manager initialized for user ID: ${client.user.id}`);
|
||||
|
||||
// Load Erela.js event handlers
|
||||
loadErelaEvents(client);
|
||||
|
||||
} catch (error) {
|
||||
logger.error(`Failed to initialize Erela.js Manager: ${error.message}`);
|
||||
// Depending on requirements, you might want to exit or handle this differently
|
||||
}
|
||||
|
||||
// Placeholder for setting activity, etc.
|
||||
// client.user.setActivity('Music!', { type: 'LISTENING' });
|
||||
|
||||
// Note: Slash command registration is typically done in a separate deploy script,
|
||||
// not usually within the ready event for production bots.
|
||||
// We will create a deploy-commands.js script later.
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user