javascript - 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)
我该怎么做才能解决这个问题?
解决方案
推荐阅读
- vba - 使用 pastespecial xlpastevalues 和 xlpasteformats 组合多个工作表
- ios - 如何在 Swift 和 Realm 中使用惰性 var?
- android - android 分页库 - 我应该使用哪个 DataSource
- perl - 从另一个调用一个 Perl 程序
- python - 如何只运行一次 Django 后台任务
- certificate - 关于会签和数字签名的查询
- powershell - Export-Csv 添加不需要的标题双引号
- spring-boot - 由于测试配置,Springboot 构建无法正常工作
- view - SQL:?从 3NF 表创建一个 VIEW 看起来像一个单行重复组
- php - php 检查为 DateTime 类提供的格式字符串的有效性