mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: Add support for sending client ready, reconnect and disconnect events to system channel
This commit is contained in:
1 parent
fab043a308
commit
6fdd943e56
4 files changed
+47
-1
No files matched your search
@@ -1,7 +1,8 @@
|
||||
const path = require('node:path');
|
||||
const logger = require(path.resolve('./src/services/logger.js'));
|
||||
const { Events, ActivityType, PresenceUpdateStatus } = require('discord.js');
|
||||
const { Events, ActivityType, PresenceUpdateStatus, EmbedBuilder } = require('discord.js');
|
||||
const { postBotStats } = require(path.resolve('./src/utils/postBotStats.js'));
|
||||
const { systemMessageChannelId, embedColors, embedIcons } = require(path.resolve('./config.json'));
|
||||
|
||||
module.exports = {
|
||||
name: Events.ClientReady,
|
||||
@@ -21,5 +22,16 @@ module.exports = {
|
||||
|
||||
// Post bot stats to bot lists in production
|
||||
process.env.NODE_ENV === 'production' ? postBotStats(client) : null;
|
||||
|
||||
// send message to system message channel for event
|
||||
if (systemMessageChannelId) {
|
||||
await client.channels.cache.get(systemMessageChannelId).send({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setDescription(`${embedIcons.success} **${client.user.tag}** is now **\`online\`**!`)
|
||||
.setColor(embedColors.colorSuccess)
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user