args and more

This commit is contained in:
Daniel Odendahl Jr
2017-03-25 04:16:27 +00:00
parent 8dd6ec1f9b
commit e2a4a92990
82 changed files with 1089 additions and 1021 deletions
+16 -24
View File
@@ -8,37 +8,29 @@ module.exports = class EmbedCommand extends commando.Command {
group: 'textedit',
memberName: 'embed',
description: 'Sends a message in an embed. (;embed This is an example.)',
examples: [';embed This is an example.']
examples: [';embed This is an example.'],
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like to embed?',
type: 'string'
}]
});
}
run(message) {
async run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'EMBED_LINKS'])) return;
}
console.log(`[Command] ${message.content}`);
let embedMessage = message.content.split(" ").slice(1).join(" ");
if (!embedMessage) {
return message.channel.send(":x: Error! Nothing to embed!");
}
else {
if (message.channel.type === 'dm') {
const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(embedMessage);
return message.channel.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(embedMessage);
message.delete();
return message.channel.sendEmbed(embed);
}
}
const embed = new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(0x00AE86)
.setTimestamp()
.setDescription(embedMessage);
let deleteMsg = await message.delete();
let embedSend = await message.channel.sendEmbed(embed);
return [deleteMsg, embedSend];
}
};