Cyanic76 / discord-modmail

THIS IS A MIRROR. ISSUES AND PR MUST BE SUBMITTED TO CODEBERG.
https://codeberg.org/Cyanic76/discord-modmail
MIT License
77 stars 48 forks source link

Issue When Messaging the Bot #13

Closed ItsDeedaya closed 3 years ago

ItsDeedaya commented 3 years ago

I'm getting an error message when I try and DM the bot, this doesn't happen on startup, only when I actually DM the bot

(node:74521) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined
    at Client.<anonymous> (/Users/evandeede/Downloads/discord-modmail/bot.js:18:30)
    at Client.emit (events.js:327:22)
    at MessageCreateAction.handle (/Users/evandeede/Downloads/discord-modmail/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/Users/evandeede/Downloads/discord-modmail/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/Users/evandeede/Downloads/discord-modmail/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/Users/evandeede/Downloads/discord-modmail/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/Users/evandeede/Downloads/discord-modmail/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/Users/evandeede/Downloads/discord-modmail/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (/Users/evandeede/Downloads/discord-modmail/node_modules/ws/lib/websocket.js:825:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:74521) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:74521) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Cyanic76 commented 3 years ago

can you copy the new bot.js file and try again?

ItsDeedaya commented 3 years ago

can you copy the new bot.js file and try again?

There are a bunch of smaller errors in this part of the code and idk how to fix them (line 75 in the new bot.js file):

client.on("message", async message => { } else { channel.send(${message.author.username} > ${whatWeWant}); } await table.set(support${message.author.id}, active); await table.set(supportChannel${channel.id}, message.author.id); await dbTable.set(support${message.author.id}, active); await dbTable.set(supportChannel${channel.id}, message.author.id); return; }

Cyanic76 commented 3 years ago

I've added 2 commits, can you try again?

Related to #15

ItsDeedaya commented 3 years ago

I've added 2 commits, can you try again?

Related to #15

Got a new error, I put it on a pastebin bcuz the error was very long: https://pastebin.com/BC9BaRdi

I've also been getting some errors saying "Unsupported Engine" when installing node.js, discord.js, and quick.db, I'm not sure if those relate (these errors had no affect on installation though)

Cyanic76 commented 3 years ago

You can find help for the "Could not locate bindings file" here.

"Unsupported engine"warn could be related to the fact that the nodejs version is too old, I'll soon look into that

ItsDeedaya commented 3 years ago

You can find help for the "Could not locate bindings file" here.

"Unsupported engine"warn could be related to the fact that the nodejs version is too old, I'll soon look into that

It works now! Thank you so much!

Cyanic76 commented 3 years ago

Nice, anytime