2020-07-06 00:53:28 +03:00
|
|
|
import { utilityCmd } from "../types";
|
2020-07-06 01:51:48 +03:00
|
|
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
2020-08-05 17:38:47 +03:00
|
|
|
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
|
|
|
|
import { sendErrorMessage } from "../../../pluginUtils";
|
2020-07-06 00:53:28 +03:00
|
|
|
|
|
|
|
export const InfoCmd = utilityCmd({
|
|
|
|
trigger: "info",
|
|
|
|
description: "Show basic information about a user",
|
|
|
|
usage: "!info 106391128718245888",
|
|
|
|
permission: "can_info",
|
|
|
|
|
|
|
|
signature: {
|
|
|
|
user: ct.resolvedUserLoose({ required: false }),
|
|
|
|
|
2020-07-06 03:05:40 +03:00
|
|
|
compact: ct.switchOption({ shortcut: "c" }),
|
2020-07-06 00:53:28 +03:00
|
|
|
},
|
|
|
|
|
2020-08-05 17:38:47 +03:00
|
|
|
async run({ message, args, pluginData }) {
|
|
|
|
const embed = await getUserInfoEmbed(pluginData, args.user.id, args.compact);
|
|
|
|
if (!embed) {
|
|
|
|
sendErrorMessage(pluginData, message.channel, "User not found");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
message.channel.createMessage({ embed });
|
2020-07-06 00:53:28 +03:00
|
|
|
},
|
|
|
|
});
|