Moved event handlers to seperate files
This commit is contained in:
10
events/ready/consolelog.js
Normal file
10
events/ready/consolelog.js
Normal file
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
name: 'conolelog',
|
||||
description: "console log",
|
||||
type: 'ready',
|
||||
|
||||
/** @param { import('discord.js').Client } client */
|
||||
execute(client) {
|
||||
console.log("Logged in as " + client.user.tag + "!");
|
||||
}
|
||||
}
|
||||
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
|
||||
}]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
36
events/ready/status.js
Normal file
36
events/ready/status.js
Normal file
@@ -0,0 +1,36 @@
|
||||
const { Events, ActivityType } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'status',
|
||||
description: 'Sets the status of the bot',
|
||||
type: 'ready',
|
||||
|
||||
/** @param { import('discord.js').Client } client */
|
||||
execute(client) {
|
||||
client.user.setActivity(
|
||||
{ name: "over the Illegitimate Server", type: ActivityType.Watching }
|
||||
);
|
||||
|
||||
const activities = [
|
||||
{ name: "for Martina's return", type: ActivityType.Watching },
|
||||
{ name: "w vri's feelings", type: ActivityType.Playing },
|
||||
{ name: "urCryhard steal finals again", type: ActivityType.Watching },
|
||||
{ name: "with Perlcence the AI", type: ActivityType.Playing },
|
||||
{ name: "with ur mom in my bed", type: ActivityType.Playing },
|
||||
{ name: "with Jone the idiot", type: ActivityType.Playing },
|
||||
{ name: "over the Illegitimate Server", type: ActivityType.Watching }
|
||||
];
|
||||
|
||||
let i = 0;
|
||||
setInterval(() =>
|
||||
client.user.setActivity(
|
||||
activities[i++ % activities.length]
|
||||
),
|
||||
1000 * 60 * 30
|
||||
)
|
||||
|
||||
client.on(Events.ClientReady, () => {
|
||||
client.user.setStatus('dnd');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user