I am getting this error in my console:
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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:33480) [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.
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 2)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 3)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 4)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 5)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 6)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 7)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 8)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 9)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 10)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 11)
(node:33480) UnhandledPromiseRejectionWarning: TypeError: Function.prototype.apply was called on #<Object>, which is
a object and not a function
at MessageCollector.handleCollect (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\structures\interfaces\Collector.js:92:53)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\RIJAK\Documents\GitHub\asta-jr\node_modules\ws\lib\websocket.js:978:20)
(node:33480) 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: 12)
and I have narrowed down the problem to this part of my code:
for (var x = 0; x < questions.length; x++) {
message.author
.send({
embed: {
title: `***Q${x + 1}. ${questions[x]}***`,
description:
"Please answer questions honestly and if asked about your details, please provide REAL life details",
footer: {
text: "You have 1 minute to answer questions!",
},
color: 0xe556f5,
},
})
.then((msg) => {
dmCh = msg.channel;
})
.catch((err) => {
message.author.send("Some error occurred");
});
dmCh.awaitMessages({ max: 1, time: 60000 })
.then((answer) => {
// answers.append(answer.toLowerCase());
console.log(answer);
})
.catch((collected) => {
// console.log(collected);
});
}
I have tried other commands of my bot and they work fine but as soon as I run this command, it gives the above-mentioned error and after this, if I type any message in the channel it gives this error. I have also tried putting a try and catch block around my code like this:
try {
dmCh.awaitMessages({ max: 1, time: 60000 })
.then((answer) => {
// answers.append(answer.toLowerCase());
console.log(answer);
})
.catch((collected) => {
// console.log(collected);
});
} catch (e) {
console.log(e);
}
but it doesn't work.
Please help me!