nt-miles / pre-coded-bot-js

A simple starting base for people just getting into discord.js
MIT License
0 stars 1 forks source link

[ISSUE WITH DISCORDJS] Command Handler actions not passing through #2

Open nt-miles opened 2 years ago

nt-miles commented 2 years ago

This issue will be pulled into discordjs/discord.js. As experimented with nt-miles/scorbunny and Blob Battles (to be determined), Discord.JS is unable to execute commands with any bots, usually providing a stack trace. Example stack traces are below.

from scorbunny's info command:

TypeError: Cannot read property '0' of undefined
 at Object.module.exports.run (C:\Users\Payto\Documents\pokemon\Scorbunny\commands\info.js:8:12)
    at module.exports (C:\Users\Payto\Documents\pokemon\Scorbunny\events\message.js:326:49)
    at Client.emit (node:events:406:35)
    at MessageCreateAction.handle (C:\Users\Payto\Documents\pokemon\Scorbunny\node_modules\discord.js\src\client\actions\MessageCreate.js:31:18)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Payto\Documents\pokemon\Scorbunny\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\Payto\Documents\pokemon\Scorbunny\node_modules\discord.js\src\client\websocket\WebSocketManager.js:345:31)
    at WebSocketShard.onPacket (C:\Users\Payto\Documents\pokemon\Scorbunny\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)
    at WebSocketShard.onMessage (C:\Users\Payto\Documents\pokemon\Scorbunny\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
    at WebSocket.onMessage (C:\Users\Payto\Documents\pokemon\Scorbunny\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (node:events:394:28)

from Blob Battles's event command:

TypeError: Cannot read property 'reply' of undefined
    at Object.module.exports.run (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\commands\event.js:10:9)
    at module.exports (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\events\messageCreate.js:484:19)
    at Client.emit (node:events:394:28)
    at MessageCreateAction.handle (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\node_modules\discord.js\src\client\actions\MessageCreate.js:23:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\node_modules\discord.js\src\client\websocket\WebSocketManager.js:345:31)
    at WebSocketShard.onPacket (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\node_modules\discord.js\src\client\websocket\WebSocketShard.js:443:22)
    at WebSocketShard.onMessage (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10)
    at WebSocket.onMessage (C:\Users\Payto\Documents\Unified Bot Workspace thing\blob battles\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (node:events:394:28)

I have attempted to troubleshoot this with DJS12 and DJS13, all to no avail.

nt-miles commented 2 years ago

Linked issue will be here.

nt-miles commented 2 years ago

Update: this does seem to be an issue with the handler itself! I will be working with the contributors to see if there's something I need to fix

nt-miles commented 2 years ago

Final Update: run() function seems to be having no arguments! I will get this fixed later tonight!