Added message events
This commit is contained in:
11
events/messages/clown.js
Normal file
11
events/messages/clown.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
module.exports = {
|
||||||
|
name: 'ur mom',
|
||||||
|
description: 'ur moms someone',
|
||||||
|
type: 'message',
|
||||||
|
|
||||||
|
async execute(message) {
|
||||||
|
if (message.content.toLowerCase().includes('ur mom') && message.author.username === "taken.lua") {
|
||||||
|
message.react("Woot:734345936347725885");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
index.js
18
index.js
@@ -198,6 +198,7 @@ client.on(Events.InteractionCreate, async interaction => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
client.on(Events.ClientReady, () => {
|
client.on(Events.ClientReady, () => {
|
||||||
|
if (process.env.NODE_ENV !== 'dev') {
|
||||||
console.log("Logged in as " + client.user.tag + "!");
|
console.log("Logged in as " + client.user.tag + "!");
|
||||||
const channel = client.channels.cache.get(botLogChannel);
|
const channel = client.channels.cache.get(botLogChannel);
|
||||||
const embedColor = Number(color.replace('#', '0x'))
|
const embedColor = Number(color.replace('#', '0x'))
|
||||||
@@ -212,8 +213,25 @@ client.on(Events.ClientReady, () => {
|
|||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// message files
|
||||||
|
const messagePath = path.join(__dirname, 'events', 'messages');
|
||||||
|
const messageFiles = fs.readdirSync(messagePath).filter(file => file.endsWith('.js'));
|
||||||
|
|
||||||
|
for (const file of messageFiles) {
|
||||||
|
|
||||||
|
const filePath = path.join(messagePath, file);
|
||||||
|
const message = require(filePath);
|
||||||
|
|
||||||
|
if (message.type === 'message') {
|
||||||
|
client.on(Events.MessageCreate, message.execute);
|
||||||
|
} else {
|
||||||
|
console.log(`[WARNING] The message at ${filePath} is missing a required "type" property.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
client.on(Events.ClientReady, () => {
|
client.on(Events.ClientReady, () => {
|
||||||
client.user.setActivity(
|
client.user.setActivity(
|
||||||
{ name: "over the Illegitimate Server", type: ActivityType.Watching }
|
{ name: "over the Illegitimate Server", type: ActivityType.Watching }
|
||||||
|
|||||||
Reference in New Issue
Block a user