Issue with messageCreate event

my messageCreate event is returning this error Error: Cannot find module '../../Schemas/Beans'
5 Replies
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
-Carlos👑
-Carlos👑OP•2y ago
fixed it, now it's returning this ReferenceError: args is not defined here's my full code:
client.on('messageCreate', async (message) => {
const db = require("./Schemas/Beans");
const arg = args[0]
let Data = await db.findOne({ User: arg }).catch(err => { })
if(Data.Bean === true) {
message.react(":seedling:")
}
})
client.on('messageCreate', async (message) => {
const db = require("./Schemas/Beans");
const arg = args[0]
let Data = await db.findOne({ User: arg }).catch(err => { })
if(Data.Bean === true) {
message.react(":seedling:")
}
})
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
-Carlos👑
-Carlos👑OP•2y ago
now it returns this TypeError: Cannot read properties of undefined (reading '0')
Unknown User
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server