So I am usually used to slapping the code in a singular spaghetti-o index.js file, yet this time I have two folders:
One for commands
One for events
While the main index.js is only with listeners for the above two in order to execute events and commands.
I am trying to get a messageCreate event trigger in a messageCreate.js within the events folder, I messed around with the intents on both the index.js and messageCreate.js event file, yet nothing seem to go through unless I did something wrong.
Here's what I am trying to do:
const { Events } = require('discord.js');
module.exports = {
name: Events.MessageCreate,
async execute(messageCreate) {
if(message.content == "Give me a random phrase for no reason!") {
var ran = [("A"),
("Some"),
("Ah"),
("You"),
("They"),
("He"),
("She"),
("Was"),
("Were"),
("Weren't"),
("Were you"),
("Weren't you"),
("Are you"),
("Aren't you"),
No need to pay attention to the rest of the code, what it does is basically simple. Grabs three variables, mashes them together and outputs a random spaghetti of words, yet whenever the trigger message is sent within the server, the code does not execute whatsoever and there is no error message either.
I tried putting it into the main index.js file to see if it would do anything different, and nothing seem to work out.
Here are the intents in the index.js file, which I tried copying into the messageCreate.js event file as well with no success:
const { Client, Collection, Events, GatewayIntentBits, GuildMessages, DirectMessages } = require('discord.js');
How can I get the messageCreate.js to be executed once the trigger message is sent?