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
|
|
|
|
2020-08-06 00:48:29 +03:00
|
|
|
export const UserInfoCmd = utilityCmd({
|
2020-12-12 20:24:09 +00:00
|
|
|
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 }),
|
|
|
|
|
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 }) {
|
2020-08-05 19:10:55 +03:00
|
|
|
const userId = args.user?.id || message.author.id;
|
2020-08-19 00:19:12 +03:00
|
|
|
const embed = await getUserInfoEmbed(pluginData, userId, args.compact, message.author.id);
|
2020-08-05 17:38:47 +03:00
|
|
|
if (!embed) {
|
|
|
|
sendErrorMessage(pluginData, message.channel, "User not found");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
message.channel.createMessage({ embed });
|
2020-07-06 00:53:28 +03:00
|
|
|
},
|
|
|
|
});
|