mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
feat: rename .js files to .ts
This commit is contained in:
1 parent
40bf9d926b
commit
92b1992b1a
54 files changed
No files matched your search
@@ -0,0 +1,43 @@
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const config = require('config');
|
||||
const embedOptions = config.get('embedOptions');
|
||||
const systemOptions = config.get('systemOptions');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'reconnecting',
|
||||
isDebug: false,
|
||||
once: false,
|
||||
execute: async (client) => {
|
||||
const executionId = uuidv4();
|
||||
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'reconnecting.js',
|
||||
module: 'event',
|
||||
name: 'clientReconnecting',
|
||||
executionId: executionId,
|
||||
shardId: client.shard.ids[0]
|
||||
});
|
||||
|
||||
logger.warn('Client is reconnecting to Discord APIs.');
|
||||
|
||||
// send message to system message channel for event
|
||||
if (systemOptions.systemMessageChannelId && systemOptions.systemUserId) {
|
||||
if (systemOptions.systemMessageChannelId && systemOptions.systemUserId) {
|
||||
const channel = await client.channels.cache.get(systemOptions.systemMessageChannelId);
|
||||
if (channel) {
|
||||
await channel.send({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setDescription(
|
||||
`${embedOptions.icons.warning} **${client.user.tag}** is **\`reconnecting\`**!` +
|
||||
`\n\n<@${systemOptions.systemUserId}>`
|
||||
)
|
||||
.setColor(embedOptions.colors.warning)
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user