AutoMod-Discord-Bot
AutoMod-Discord-Bot copied to clipboard
Error with finding channels, and role detection
I'm not sure if this issue stems from the recent discord updates, but this error is thrown whenever it is run, and towards the bottom at C:\AutoMod-Discord-Bot-master\node_modules\discord-anti-spam\anti_spam.js:32 an error is thrown when a message is typed
(node:41884) UnhandledPromiseRejectionWarning: TypeError: client.channels.find is not a function
at Object.exports.run (C:\AutoMod-Discord-Bot-master\events\ready.js:5:21)
at Client.<anonymous> (C:\AutoMod-Discord-Bot-master\bot.js:33:53)
at Client.emit (events.js:315:20)
at WebSocketManager.triggerClientReady (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:431:17)
at WebSocketManager.checkShardsReady (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:415:10)
at WebSocketShard.<anonymous> (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:197:14)
at WebSocketShard.emit (events.js:315:20)
at WebSocketShard.checkReady (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
at WebSocketShard.onPacket (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:447:16)
at WebSocketShard.onMessage (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:41884) 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:41884) [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.
C:\AutoMod-Discord-Bot-master\node_modules\discord-anti-spam\anti_spam.js:32
if(msg.member && msg.member.roles.some(r => exemptRoles.includes(r.name))) return;
^
TypeError: msg.member.roles.some is not a function
at Client.<anonymous> (C:\AutoMod-Discord-Bot-master\node_modules\discord-anti-spam\anti_spam.js:32:39)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\AutoMod-Discord-Bot-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\AutoMod-Discord-Bot-master\node_modules\ws\lib\event-target.js:132:16)