3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-22 09:15:03 +00:00

Finish preliminary rework, ready to test

This commit is contained in:
Dark 2021-06-02 04:07:50 +02:00
parent 293a850075
commit c99e745f89
177 changed files with 854 additions and 707 deletions

View file

@ -2,6 +2,7 @@ import { botControlCmd } from "../types";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { resolveInvite, verboseUserMention } from "../../../utils";
import { TextChannel } from "discord.js";
const REQUIRED_MEMBER_COUNT = 5000;
@ -18,7 +19,7 @@ export const EligibleCmd = botControlCmd({
if ((await pluginData.state.apiPermissionAssignments.getByUserId(args.user.id)).length) {
sendSuccessMessage(
pluginData,
msg.channel,
msg.channel as TextChannel,
`${verboseUserMention(args.user)} is an existing bot operator. They are eligible!`,
);
return;
@ -26,17 +27,17 @@ export const EligibleCmd = botControlCmd({
const invite = await resolveInvite(pluginData.client, args.inviteCode, true);
if (!invite || !invite.guild) {
sendErrorMessage(pluginData, msg.channel, "Could not resolve server from invite");
sendErrorMessage(pluginData, msg.channel as TextChannel, "Could not resolve server from invite");
return;
}
if (invite.guild.features.includes("PARTNERED")) {
sendSuccessMessage(pluginData, msg.channel, `Server is partnered. It is eligible!`);
sendSuccessMessage(pluginData, msg.channel as TextChannel, `Server is partnered. It is eligible!`);
return;
}
if (invite.guild.features.includes("VERIFIED")) {
sendSuccessMessage(pluginData, msg.channel, `Server is verified. It is eligible!`);
sendSuccessMessage(pluginData, msg.channel as TextChannel, `Server is verified. It is eligible!`);
return;
}
@ -44,7 +45,7 @@ export const EligibleCmd = botControlCmd({
if (memberCount >= REQUIRED_MEMBER_COUNT) {
sendSuccessMessage(
pluginData,
msg.channel,
msg.channel as TextChannel,
`Server has ${memberCount} members, which is equal or higher than the required ${REQUIRED_MEMBER_COUNT}. It is eligible!`,
);
return;
@ -52,7 +53,7 @@ export const EligibleCmd = botControlCmd({
sendErrorMessage(
pluginData,
msg.channel,
msg.channel as TextChannel,
`Server **${invite.guild.name}** (\`${invite.guild.id}\`) is not eligible`,
);
},