3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-19 15:30:00 +00:00
zeppelin/backend/src/plugins/Utility/commands/ChannelInfoCmd.ts

26 lines
789 B
TypeScript
Raw Normal View History

2020-08-05 22:54:14 +03:00
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
export const ChannelInfoCmd = utilityCmd({
trigger: ["channel", "channelinfo"],
description: "Show information about a channel",
usage: "!channel 534722016549404673",
permission: "can_channel",
signature: {
channel: ct.channelId({ required: false }),
},
async run({ message, args, pluginData }) {
const embed = await getChannelInfoEmbed(pluginData, args.channel);
if (!embed) {
sendErrorMessage(pluginData, message.channel, "Unknown channel");
return;
}
message.channel.createMessage({ embed });
},
});