mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 14:55:40 +02:00
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
const Command = require('../../structures/Command');
|
||
const { MessageEmbed } = require('discord.js');
|
||
const moment = require('moment');
|
||
|
||
module.exports = class ChannelInfoCommand extends Command {
|
||
constructor(client) {
|
||
super(client, {
|
||
name: 'channel-info',
|
||
aliases: ['channel'],
|
||
group: 'guild-info',
|
||
memberName: 'channel-info',
|
||
description: 'Responds with detailed information on a channel.',
|
||
guildOnly: true,
|
||
clientPermissions: ['EMBED_LINKS'],
|
||
args: [
|
||
{
|
||
key: 'channel',
|
||
prompt: 'Which channel would you like to get information on?',
|
||
type: 'channel',
|
||
default: ''
|
||
}
|
||
]
|
||
});
|
||
}
|
||
|
||
run(msg, args) {
|
||
const channel = args.channel || msg.channel;
|
||
const embed = new MessageEmbed()
|
||
.setColor(0x00AE86)
|
||
.addField('❯ Name',
|
||
channel.name, true)
|
||
.addField('❯ ID',
|
||
channel.id, true)
|
||
.addField('❯ NSFW',
|
||
channel.nsfw ? 'Yes' : 'No', true)
|
||
.addField('❯ Creation Date',
|
||
moment(channel.createdAt).format('MMMM Do YYYY'), true)
|
||
.addField('❯ Topic',
|
||
channel.topic || 'None');
|
||
return msg.embed(embed);
|
||
}
|
||
};
|