3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 00:35:02 +00:00
zeppelin/backend/src/plugins/Utility/commands/RoleInfoCmd.ts
2021-05-05 02:20:52 +01:00

26 lines
778 B
TypeScript

import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed";
export const RoleInfoCmd = utilityCmd({
trigger: ["role", "roleinfo"],
description: "Show information about a role",
usage: "!role 106391128718245888",
permission: "can_roleinfo",
signature: {
role: ct.role({ required: false }),
},
async run({ message, args, pluginData }) {
if (!args.role) {
sendErrorMessage(pluginData, message.channel, "Role not found");
return;
}
const embed = await getRoleInfoEmbed(pluginData, args.role, message.author.id);
message.channel.createMessage({ embed });
},
});