Add !channel/!channelinfo
This commit is contained in:
parent
a1a5952e44
commit
14af94e7a3
10 changed files with 144 additions and 0 deletions
25
backend/src/plugins/Utility/commands/ChannelInfoCmd.ts
Normal file
25
backend/src/plugins/Utility/commands/ChannelInfoCmd.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
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 });
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue