mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
const { Command } = require('discord.js-commando');
|
|
const { RichEmbed } = require('discord.js');
|
|
|
|
module.exports = class EmbedCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'embed',
|
|
group: 'textedit',
|
|
memberName: 'embed',
|
|
description: 'Sends a message in an embed.',
|
|
args: [{
|
|
key: 'text',
|
|
prompt: 'What text would you like to embed?',
|
|
type: 'string'
|
|
}]
|
|
});
|
|
}
|
|
|
|
run(message, args) {
|
|
if (message.channel.type !== 'dm')
|
|
if (!message.channel.permissionsFor(this.client.user).permissions.has('EMBED_LINKS'))
|
|
return message.say('This Command requires the `Embed Links` Permission.');
|
|
const { text } = args;
|
|
const embed = new RichEmbed()
|
|
.setAuthor(message.author.username, message.author.avatarURL)
|
|
.setColor(0x00AE86)
|
|
.setTimestamp()
|
|
.setDescription(text);
|
|
return message.embed(embed);
|
|
}
|
|
};
|