Closed Superredstone closed 2 years ago
Hey there, thanks for the report.
Looks like you're missing the options object in your client constructor, which is required in slasher.
Try changing that line to this
const client = new SlasherClient({ useAuth: true });
Let me know if this issue still persists.
Thank you
That works! Thanks. (And sorry for the stupid question)
The application crashes with the following error:
C:\Users\Patrick\Documents\Programming\JS\mastery-bot\node_modules\discord.js-slasher\build\src\api\wrapped-client.js:139 if (!options.intents) { ^
TypeError: Cannot read properties of undefined (reading 'intents') at filterOptions (C:\Users\Patrick\Documents\Programming\JS\mastery-bot\node_modules\discord.js-slasher\build\src\api\wrapped-client.js:139:18) at new SlasherClient (C:\Users\Patrick\Documents\Programming\JS\mastery-bot\node_modules\discord.js-slasher\build\src\api\wrapped-client.js:17:15) at Object. (C:\Users\Patrick\Documents\Programming\JS\mastery-bot\index.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1119:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1173:10)
at Module.load (node:internal/modules/cjs/loader:997:32)
at Module._load (node:internal/modules/cjs/loader:838:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:18:47
Node.js v18.9.0
To Reproduce Steps to reproduce the behavior:
const { SlasherClient } = require("discord.js-slasher");
const client = new SlasherClient();
client.on("ready", () => { console.log(
Bot logged in as ${client.user.tag}
); });client.on("command", (ctx) => { if (ctx.command == "test") { ctx.reply(
This is a test! You are ${ctx.user.username}!
) } });client.login();
npx slasher
and save auth.jsonnode index.js
Environment (please complete the following information):