【发布时间】:2021-09-30 05:16:23
【问题描述】:
我正在使用 discord.js 12,我尝试了以下方法:
client.channels.cache.find(x => x.id == "id").send('message')
client.channels.cache.find(x => x.name == "channel-name").send('message')
...and...
client.channels.cache.get('id').send('message')
并且它们都返回一个错误说'无法读取未定义的属性'发送'。
现在,我知道这通常意味着频道的 ID 错误。但是,我已经复制了它并重复了五次。我向你保证,这是正确的 ID。
我已经使用这个系统几个月了,现在它不能工作了。
注意:我在文件中定义了以下内容:
const Discord = require('discord.js')
const client = new Discord.Client()
请帮帮我!
【问题讨论】:
标签: javascript node.js discord.js