3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-12 12:55:02 +00:00

Rename !info to !user/!userinfo

This commit is contained in:
Dragory 2020-08-06 00:48:29 +03:00
parent e8ff297368
commit 7ad2458fd9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
3 changed files with 10 additions and 7 deletions

View file

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