3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 11:37:20 +00:00
zeppelin/backend/src/plugins/Utility/commands/ServerInfoCmd.ts
2024-04-15 15:51:45 +02:00

26 lines
874 B
TypeScript

import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { utilityCmd } from "../types";
export const ServerInfoCmd = utilityCmd({
trigger: ["server", "serverinfo"],
description: "Show server information",
usage: "!server",
permission: "can_server",
signature: {
serverId: ct.string({ required: false }),
},
async run({ message, pluginData, args }) {
const serverId = args.serverId || pluginData.guild.id;
const serverInfoEmbed = await getServerInfoEmbed(pluginData, serverId);
if (!serverInfoEmbed) {
void pluginData.state.common.sendErrorMessage(message, "Could not find information for that server");
return;
}
message.channel.send({ embeds: [serverInfoEmbed] });
},
});