首页 > 解决方案 > ReferenceError:频道未使用 discord.js 定义

问题描述

我想让我的机器人使用 discord.js 将图像发送到频道,但是,我收到了这个错误

ReferenceError: channel is not defined
    at Client.<anonymous> (C:\디스코드 봇\jaewonbot\discord-bot\index.js:70:5)
    at Client.emit (events.js:388:22)
    at MessageCreateAction.handle (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)      
    at WebSocketManager.handlePacket (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\ws\lib\event-target.js:132:16)
    at WebSocket.emit (events.js:376:20)
    at Receiver.receiverOnMessage (C:\디스코드 봇\jaewonbot\discord-bot\node_modules\ws\lib\websocket.js:834:20)

我该怎么做才能解决这个问题?

标签: javascriptnode.jsdiscord.js

解决方案


推荐阅读