SimonLeclere / discord-easy-dashboard

💻 Simple module to facilitate the creation of dashboard using discord.js and express
https://www.npmjs.com/package/discord-easy-dashboard
71 stars 11 forks source link

Cannot Read Property 'name' #2

Closed Aidan-The-Dev closed 3 years ago

Aidan-The-Dev commented 3 years ago

So im trying to use your package here is the code

const discord = require('discord.js')
const intents = new discord.Intents(32767)
const client = new discord.Client({intents})
const Dashboard = require('discord-easy-dashboard')

const dashboard = new Dashboard(client)

client.dashboard = dashboard

client.login(MyToken)

and here is the error

C:\Users\ocean\Documents\test-dashboard\node_modules\discord-easy-dashboard\index.js:19 name: options.name || client.user.username || null, ^

TypeError: Cannot read property 'name' of undefined at new Dashboard (C:\Users\ocean\Documents\test-dashboard\node_modules\discord-easy-dashboard\index.js:19:18) at Object. (C:\Users\ocean\Documents\test-dashboard\index.js:6:19) at Module._compile (node:internal/modules/cjs/loader:1095:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10) at Module.load (node:internal/modules/cjs/loader:975:32) at Function.Module._load (node:internal/modules/cjs/loader:816:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) at node:internal/main/run_main_module:17:47

SimonLeclere commented 3 years ago

I just fixed the problem, it should work now (just update the module). If not, try specifying the name option:

const dashboard = new Dashboard(client, { name: 'superCoolBot' });