【发布时间】:2022-06-13 15:27:09
【问题描述】:
我收到这个错误很长时间了:RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: MESSAGE,我不明白为什么,我认为这是因为不和谐改变了版本和东西,但我不是一个很好的脚本编写者和一种对整个人来说都是新的,所以如果有人可以帮助我,我会很高兴!
该脚本假设在 CodeLyon 教程之后做出反应角色,这有点过时了。
这是脚本:
module.exports = {
name: 'reactionroles',
description: "Sets up a reaction role message",
execute(message, args, Discord, client) {
const channel = '983816110958866492'
const gameNightsRole = message.guild.roles.cache.find(role => role.name === "『Game Nights』");
const pollsRole = message.guild.roles.cache.find(role => role.name === "『Polls』");
const commSugRole = message.guild.roles.cache.find(role => role.name === "『Community Suggestions』");
const gameNightsEmoji = ':video_game:';
const pollsEmoji = ':hourglass:';
const commSugEmoji = ':bulb:';
let embed = new Discord.MessageEmbed()
.setColor('')
.setTitle('Reaction Roles')
.setDescription('Choosing a reaction role will let us know you want to be pinged for those things !')
+ `${gameNightsEmoji} for be pinged in game nights !`
+ `${pollsEmoji} for be pinged in server polls !`
+ `${commSugEmoji} for be pinged in community suggestions !`;
let reactionEmbed = await message.channel.send(embed);
reactionEmbed.react(gameNightsEmoji);
reactionEmbed.react(pollsEmoji);
reactionEmbed.react(commSugEmoji);
}
}
【问题讨论】:
-
您应该向我们展示您是如何创建
client实例的。 -
我在想,也许是因为
Intents。MESSAGE=>GUILD_MESSAGES -
请澄清您的具体问题或提供更多详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
标签: discord discord.js