Dylan
Dylan
DIAdiscord.js - Imagine an app
Created by Dylan on 7/2/2024 in #djs-questions
Cannot read properties of undefined (reading 'reduce')
I have two apps and this error is happening on both when I try to run any interaction.
C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\BaseInteraction.js:106
this.entitlements = data.entitlements.reduce(
^

TypeError: Cannot read properties of undefined (reading 'reduce')
at new BaseInteraction (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\BaseInteraction.js:106:43)
at new CommandInteraction (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\CommandInteraction.js:16:5)
at new ChatInputCommandInteraction (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\ChatInputCommandInteraction.js:13:5)
at InteractionCreateAction.handle (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\actions\InteractionCreate.js:90:25)
at module.exports [as INTERACTION_CREATE] (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
at WebSocketShard.<anonymous> (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\@discordjs\ws\dist\index.js:1190:51)
at WebSocketShard.emit (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)

Node.js v20.11.1
C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\BaseInteraction.js:106
this.entitlements = data.entitlements.reduce(
^

TypeError: Cannot read properties of undefined (reading 'reduce')
at new BaseInteraction (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\BaseInteraction.js:106:43)
at new CommandInteraction (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\CommandInteraction.js:16:5)
at new ChatInputCommandInteraction (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\structures\ChatInputCommandInteraction.js:13:5)
at InteractionCreateAction.handle (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\actions\InteractionCreate.js:90:25)
at module.exports [as INTERACTION_CREATE] (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\websocket\WebSocketManager.js:355:31)
at WebSocketManager.<anonymous> (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\discord.js\src\client\websocket\WebSocketManager.js:239:12)
at WebSocketManager.emit (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)
at WebSocketShard.<anonymous> (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\@discordjs\ws\dist\index.js:1190:51)
at WebSocketShard.emit (C:\Users\the1a\Downloads\apps\dyLcore\node_modules\@vladfrangu\async_event_emitter\dist\index.cjs:282:31)

Node.js v20.11.1
5 replies
DIAdiscord.js - Imagine an app
Created by Dylan on 6/10/2024 in #djs-questions
ContextMenuCommandBuilder Permissions
I'm trying to add a User Command, and the permisisons through PermissionFlagsBits but I get an error. Here is the code snippet:
data: new ContextMenuCommandBuilder()
.setName("View User Avatar")
.setType(2)
.setDMPermission(true)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers),
data: new ContextMenuCommandBuilder()
.setName("View User Avatar")
.setType(2)
.setDMPermission(true)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers),
And the error output:
Failed to update commands: Cannot read properties of undefined (reading 'ModerateMembers')
Failed to update commands: Cannot read properties of undefined (reading 'ModerateMembers')
discord.js v14.15.3 and node v20.11.1
7 replies