15 lines
435 B
JavaScript
15 lines
435 B
JavaScript
const api = require('../api');
|
|
|
|
module.exports = {
|
|
name: 'guildCreate',
|
|
execute: async (guild, client) => {
|
|
console.log(`Bot joined guild: ${guild.name} (${guild.id})`);
|
|
|
|
try {
|
|
// Publish SSE event for bot status change
|
|
await api.publishEvent('*', 'botStatusUpdate', { guildId: guild.id, isBotInServer: true });
|
|
} catch (error) {
|
|
console.error('Error publishing bot join event:', error);
|
|
}
|
|
},
|
|
}; |