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:
parent
e8ff297368
commit
7ad2458fd9
3 changed files with 10 additions and 7 deletions
28
backend/src/plugins/Utility/commands/UserInfoCmd.ts
Normal file
28
backend/src/plugins/Utility/commands/UserInfoCmd.ts
Normal 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 });
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue