我有一个关于嵌入命令的问题,我试图让用户在这个嵌入命令中选择颜色代码,但这是一个错误:RangeError: Argument type "colorcode" isn't registered.。
我的代码:
const { Command } = require('discord.js-commando');
const { RichEmbed } = require('discord.js');
module.exports = class EmbedCommand extends Command {
constructor(client) {
super(client, {
name: 'embed',
group: 'extra commands',
memberName: 'embed',
description: 'Replies with the text you provide, But in Embed.',
args: [
{
key:"text",
prompt:"What Should the Embed Say?",
type:"string",
},
{
key:"color",
prompt:"What Color should the Embed be? (Use Color Codes.). Use RANDOM for Random Color. (Must Be All Caps!).",
type:'colorcode',
}
]
});
}
run(msg, { text }) {
msg.delete();
let embed = new RichEmbed()
.setTitle(text)
.setColor(color)
msg.embed(embed)
}
};。
有人知道如何取代colorcode吗?
发布于 2019-03-30 23:57:55
使用type: 'string',而不是type:'colorcode',,并且不要忘记更改:
run(msg, { text }) {到run(msg, { text, color }) {。
您还可以转到discord.js Commando的Repository并创建一个Issue/Feature Request,建议为Color/ColorResolveable添加一个新类型。
https://stackoverflow.com/questions/55432443
复制相似问题