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 toolkit2y 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
Syjalo2y ago
That's basic JavaScript error
Syjalo
Syjalo2y ago
Here's where it comes from
Syjalo
Syjalo2y ago
ticket.js line 20 symbol 25
d.js docs
d.js docs2y ago
- ReferenceError: "x" is not defined: learn more - TypeError: Cannot read properties of undefined/null (reading "x"): learn more
maybeizen
maybeizenOP2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y 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
maybeizenOP2y ago
Either of them work.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
nvm just bad english Users or members dont work ive tried both
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
It doesnt.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
The one in console that I sent here
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
Im not updating the pastebin im on vscode...
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
well anyways its using member now
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
maybeizen
maybeizenOP2y ago
same thing
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
I told it to
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
below this if ( !interaction.member.permissions.has( PermissionsBitField.Flags.Administrator, ),
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
tell me if this helps because i cant read errors very well
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
ive placed the log above the if statement like you said
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
Okay it logged ill send it in a bin because its super long
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
that means the log has to be moved under the if statement yeah?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
okay it didnt log anything
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
just the error from before
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
okay well I got another error
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
its commented
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
well hang on
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
Yea I fixed it and it didnt log anything
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
The code? well
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y ago
duh
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
maybeizen
maybeizenOP2y 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