mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-22 09:15:03 +00:00
Fix various issues with the info commands (#151)
Fixed !info not checking for any of the sub-permissions Fixed message/channel/invite checking non-existent permissions Fixed ServerCmd being out of line with the rest of the info commands name-wise
This commit is contained in:
parent
9724000795
commit
6539b7c8f1
6 changed files with 23 additions and 14 deletions
|
@ -1,26 +0,0 @@
|
|||
import { utilityCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
|
||||
|
||||
export const ServerCmd = 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, message.author.id);
|
||||
if (!serverInfoEmbed) {
|
||||
sendErrorMessage(pluginData, message.channel, "Could not find information for that server");
|
||||
return;
|
||||
}
|
||||
|
||||
message.channel.createMessage({ embed: serverInfoEmbed });
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue