Files
xiao/commands/info/message.js
T

36 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
module.exports = class MessageInfoCommand extends Command {
constructor(client) {
super(client, {
name: 'message-info',
aliases: ['message', 'msg', 'msg-info', 'reply'],
group: 'info',
memberName: 'message',
description: 'Responds with detailed information on a message.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'message',
prompt: 'Which message would you like to get information on?',
type: 'message'
}
]
});
}
run(msg, { message }) {
const format = message.author.avatar && message.author.avatar.startsWith('a_') ? 'gif' : 'png';
const embed = new MessageEmbed()
.setColor(message.member ? message.member.displayHexColor : 0x00AE86)
.setThumbnail(message.author.displayAvatarURL({ format }))
.setAuthor(message.author.tag, message.author.displayAvatarURL({ format }))
.setDescription(message.content)
.setTimestamp(message.createdAt)
.setFooter(`ID: ${message.id}`)
.addField(' Jump', message.url);
return msg.embed(embed);
}
};