Issues With Permissions

Im going to say it now, Im terrible at coding and I have zero idea what I'm doing. Anyways I'm getting a permissions error in terminal and I have no idea how to resolve it. Can someone help me please? Thank you! Here is the code: https://paste.alienhost.net/kupubawefa.typescript
56 Replies
d.js toolkit
d.js toolkit17mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Syjalo
Syjalo17mo ago
That's basic JavaScript error
Syjalo
Syjalo17mo ago
Here's where it comes from
Syjalo
Syjalo17mo ago
ticket.js line 20 symbol 25
d.js docs
d.js docs17mo ago
- ReferenceError: "x" is not defined: learn more - TypeError: Cannot read properties of undefined/null (reading "x"): learn more
maybeizen
maybeizenOP17mo ago
Yea, I know. But I dont know how to fix it. I was hoping I could get some guidence on that.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs17mo ago
Despite sounding similar there is a distinct difference between users and members in Discord: - User: global Discord user data (global avatar, username, tag, id) - GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.) - Conversion: User ➞ GuildMember | GuildMember ➞ User * Note: Events received in cached guilds will often have both the member and user available, eg. interaction.user and interaction.member
maybeizen
maybeizenOP17mo ago
Either of them work.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
nvm just bad english Users or members dont work ive tried both
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
It doesnt.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
The one in console that I sent here
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
Im not updating the pastebin im on vscode...
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
well anyways its using member now
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
maybeizen
maybeizenOP17mo ago
same thing
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
I told it to
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
below this if ( !interaction.member.permissions.has( PermissionsBitField.Flags.Administrator, ),
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
tell me if this helps because i cant read errors very well
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
ive placed the log above the if statement like you said
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
Okay it logged ill send it in a bin because its super long
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
that means the log has to be moved under the if statement yeah?
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
okay it didnt log anything
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
just the error from before
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
okay well I got another error
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector') at Object.run (Z:\AmazeBot 2.0\commands\ticket.js:47:33) at CommandHandler.<anonymous> (Z:\AmazeBot 2.0\node_modules\djs-commander\dist\index.js:355:25) at Generator.next (<anonymous>) at Z:\AmazeBot 2.0\node_modules\djs-commander\dist\index.js:68:61 at new Promise (<anonymous>) at __async (Z:\AmazeBot 2.0\node_modules\djs-commander\dist\index.js:52:10) at Client.<anonymous> (Z:\AmazeBot 2.0\node_modules\djs-commander\dist\index.js:333:59) at Client.emit (node:events:513:28) at InteractionCreateAction.handle (Z:\AmazeBot 2.0\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12) at module.exports [as INTERACTION_CREATE] (Z:\AmazeBot 2.0\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36) Emitted 'error' event on Client instance at: at emitUnhandledRejectionOrErr (node:events:394:10) at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
its commented
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
well hang on
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
Yea I fixed it and it didnt log anything
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
The code? well
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
duh
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP17mo ago
Thanks for all your help, I will try some things out. I need sleep too lol Thanks again
Want results from more Discord servers?
Add your server