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/UserInfoCmd.ts

29 lines
902 B
TypeScript
Raw Normal View History

import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { utilityCmd } from "../types";
2020-07-06 00:53:28 +03:00
2020-08-06 00:48:29 +03:00
export const UserInfoCmd = utilityCmd({
trigger: ["user", "userinfo", "whois"],
2020-08-06 00:48:29 +03:00
description: "Show information about a user",
usage: "!user 106391128718245888",
permission: "can_userinfo",
2020-07-06 00:53:28 +03:00
signature: {
user: ct.resolvedUserLoose({ required: false }),
compact: ct.switchOption({ shortcut: "c" }),
2020-07-06 00:53:28 +03:00
},
async run({ message, args, pluginData }) {
const userId = args.user?.id || message.author.id;
const embed = await getUserInfoEmbed(pluginData, userId, args.compact, message.author.id);
if (!embed) {
sendErrorMessage(pluginData, message.channel, "User not found");
return;
}
message.channel.send({ embed });
2020-07-06 00:53:28 +03:00
},
});