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