Files
xiao/commands/info/channel.js
T
Daniel Odendahl Jr d74e2c9d96 Revert "choice argument type"
This reverts commit 679bb538cb.
2018-03-17 13:22:07 +00:00

52 lines
1.3 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('discord.js-commando');
const { MessageEmbed } = require('discord.js');
const types = {
dm: 'DM',
group: 'Group DM',
text: 'Text Channel',
voice: 'Voice Channel',
category: 'Category',
unknown: 'Unknown'
};
module.exports = class ChannelInfoCommand extends Command {
constructor(client) {
super(client, {
name: 'channel-info',
aliases: ['channel'],
group: 'info',
memberName: 'channel',
description: 'Responds with detailed information on a channel.',
clientPermissions: ['EMBED_LINKS'],
args: [
{
key: 'channel',
prompt: 'Which channel would you like to get information on?',
type: 'channel',
default: msg => msg.channel
}
]
});
}
run(msg, { channel }) {
const embed = new MessageEmbed()
.setColor(0x00AE86)
.addField(' Name',
channel.name || 'None', true)
.addField(' ID',
channel.id, true)
.addField(' NSFW',
channel.nsfw ? 'Yes' : 'No', true)
.addField(' Category',
channel.parent ? channel.parent.name : 'None', true)
.addField(' Type',
types[channel.type], true)
.addField(' Creation Date',
channel.createdAt.toDateString(), true)
.addField(' Topic',
channel.topic || 'None');
return msg.embed(embed);
}
};