Moved event handlers to seperate files
This commit is contained in:
27
events/ready/sendOnlineMessage.js
Normal file
27
events/ready/sendOnlineMessage.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const { Events } = require('discord.js');
|
||||
const { botLogChannel, color } = require('../../config/options.json');
|
||||
|
||||
module.exports = {
|
||||
name: 'sendonlinemessage',
|
||||
description: "send an online message",
|
||||
type: 'ready',
|
||||
|
||||
execute(client) {
|
||||
if (process.env.NODE_ENV !== 'dev') {
|
||||
console.log("Logged in as " + client.user.tag + "!");
|
||||
const channel = client.channels.cache.get(botLogChannel);
|
||||
const embedColor = Number(color.replace('#', '0x'))
|
||||
|
||||
if (!channel) {
|
||||
return;
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
description: `Bot is online!`,
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user