嵌入命令(颜色)(discord.js-commando)
Embed Command (Colors) (discord.js-commando)
我遇到了有关嵌入命令的问题,我试图让用户在此嵌入命令中选择颜色代码,但这是我遇到的错误: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
?
而不是 type:'colorcode',
使用 type: 'string',
并且不要忘记更改:
run(msg, { text }) {
到 run(msg, { text, color }) {
.
您也可以转到 Repository of discord.js Commando
and create a Issue/Feature Request 以建议为 Color/ColorResolveable
添加新类型。
我遇到了有关嵌入命令的问题,我试图让用户在此嵌入命令中选择颜色代码,但这是我遇到的错误: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
?
而不是 type:'colorcode',
使用 type: 'string',
并且不要忘记更改:
run(msg, { text }) {
到 run(msg, { text, color }) {
.
您也可以转到 Repository of discord.js Commando
and create a Issue/Feature Request 以建议为 Color/ColorResolveable
添加新类型。