#Typescript Error

17 messages · Page 1 of 1 (latest)

clever fossil
#

TypeError: Cannot read properties of undefined (reading 'getString')
at Object.execute (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\commands\general\announoucement.js:31:40)
at Object.execute (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\events\interactionCreate.js:16:18)
at Client.<anonymous> (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\index.js:43:44)
at Client.emit (node:events:518:28)
at InteractionCreateAction.handle (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\node_modules\discord.js\src\client\actions\InteractionCreate.js:101:12)
at module.exports [as INTERACTION_CREATE] (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketManager.<anonymous> (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:236:12)
at WebSocketManager.emit (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\node_modules@vladfrangu\async_event_emitter\dist\index.cjs:2504:31)
at WebSocketShard.<anonymous> (C:\Users\timpu\OneDrive\Dev Projects\NovaEagle Bot\node_modules@discordjs\ws\dist\index.js:1190:51)

this happens when i try to test the slash command out

random falconBOT
balmy tiger
#

And your code?

clever fossil
#

the code is here

#

@balmy tiger

subtle sleetBOT
#

To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.

clever fossil
#

here

sly nacelle
#

Not option

#

Assuming interaction is an interaction

clever fossil
#

oh

#

i think interaction.options

subtle sleetBOT
clever fossil
#

when i type /announcement, it gave me DiscordAPIError[10062]: Unknown interaction

subtle sleetBOT
#

Common causes of DiscordAPIError[10062]: Unknown interaction:

  • Initial response took more than 3 seconds ➞ defer the response *.
  • Wrong interaction object inside a collector.
  • Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance)
    * Note: you cannot defer modal or autocomplete value responses
vapid bramble