【发布时间】:2020-12-27 18:44:54
【问题描述】:
我正在创建角色列表命令,但结果发现我的角色太多。无论如何,将消息拆分为更多。角色存储在一个数组中。顺便说一句,我只想要以 A 开头的角色。
const roles = message.guild.roles.cache.filter(c => c.name.startsWith('A'))
这是控制台中的错误
Invalid Form Body content: Must be 2000 or fewer in length.
module.exports = {
name: 'rolelist',
description: 'Sends A List Of Roles Availible In The Server',
execute(message, args, client) {
if (!message.content.startsWith(prefix) || message.author.bot) return;
const roles = message.guild.roles.cache.filter(c => c.name.startsWith('A'))
if (colors.size < 1) {
return message.channel.send('There are no roles starting with the letter A');
}
message.channel.send(roles.array().join(` \n`), {split:true,})
},
};
【问题讨论】:
标签: discord discord.js