Множество ошибок при запуске бота
Бота я пишу на node JS. Он предназначен для Дискорда.
Я решил залить весь код:
https://yadi.sk/d/KBqynLnoxoiO2w
Суть в том, что когда я пишу команду "ping", бот должен мне ответить "pong".
Вот сами логи:
(node:10496) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'bot' of undefined
at Client.<anonymous> (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\ShiroBot.js:28:31)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\miste\OneDrive\Рабочий стол\ShiroBot\node_modules\ws\lib\websocket.js:800:20)
(node:10496) 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:10496) [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.