3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 08:45:03 +00:00

added roleinfo command

This commit is contained in:
Almeida 2021-05-05 00:58:08 +01:00
parent edd78fc9c6
commit 89a4b4a153
5 changed files with 115 additions and 3 deletions

View file

@ -0,0 +1,28 @@
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 }) {
const roleId = args.role?.id;
const role = roleId && pluginData.guild.roles.get(roleId);
if (!role) {
sendErrorMessage(pluginData, message.channel, "Role not found");
return;
}
const embed = await getRoleInfoEmbed(pluginData, role, message.author.id);
message.channel.createMessage({ embed });
},
});