mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 18:25:03 +00:00
remove unused imports & add prettier plugin
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
33c6ae2188
commit
59bf98f928
289 changed files with 861 additions and 834 deletions
|
@ -1,6 +1,7 @@
|
|||
import { GuildMember, Message, Snowflake } from "discord.js";
|
||||
import { EventEmitter } from "events";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||
|
@ -8,6 +9,7 @@ import { mapToPublicFn } from "../../pluginUtils";
|
|||
import { Queue } from "../../Queue";
|
||||
import { MINUTES, trimPluginDescription } from "../../utils";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
|
@ -37,6 +39,7 @@ import { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEv
|
|||
import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt";
|
||||
import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt";
|
||||
import { banUserId } from "./functions/banUserId";
|
||||
import { clearTempban } from "./functions/clearTempban";
|
||||
import { hasMutePermission } from "./functions/hasMutePerm";
|
||||
import { kickMember } from "./functions/kickMember";
|
||||
import { offModActionsEvent } from "./functions/offModActionsEvent";
|
||||
|
@ -44,9 +47,6 @@ import { onModActionsEvent } from "./functions/onModActionsEvent";
|
|||
import { updateCase } from "./functions/updateCase";
|
||||
import { warnMember } from "./functions/warnMember";
|
||||
import { BanOptions, ConfigSchema, KickOptions, ModActionsPluginType, WarnOptions } from "./types";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
import { clearTempban } from "./functions/clearTempban";
|
||||
|
||||
const defaultOptions = {
|
||||
config: {
|
||||
|
|
|
@ -4,9 +4,9 @@ import { Case } from "../../../data/entities/Case";
|
|||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -2,18 +2,18 @@ import humanizeDuration from "humanize-duration";
|
|||
import { getMemberLevel } from "knub/dist/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { banLock } from "../../../utils/lockNameHelpers";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { banUserId } from "../functions/banUserId";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -5,11 +5,11 @@ import { LogType } from "../../../data/LogType";
|
|||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DAYS, MINUTES, resolveMember, resolveUser } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -7,11 +7,11 @@ import { LogType } from "../../../data/LogType";
|
|||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DAYS, MINUTES, SECONDS, noop } from "../../../utils";
|
||||
import { DAYS, MINUTES, noop, SECONDS } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
export const MassbanCmd = modActionsCmd({
|
||||
trigger: "massban",
|
||||
|
|
|
@ -5,11 +5,11 @@ import { CaseTypes } from "../../../data/CaseTypes";
|
|||
import { LogType } from "../../../data/LogType";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
export const MassunbanCmd = modActionsCmd({
|
||||
trigger: "massunban",
|
||||
|
|
|
@ -5,9 +5,9 @@ import { LogType } from "../../../data/LogType";
|
|||
import { logger } from "../../../logger";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
export const MassmuteCmd = modActionsCmd({
|
||||
trigger: "massmute",
|
||||
|
|
|
@ -3,9 +3,9 @@ import { CaseTypes } from "../../../data/CaseTypes";
|
|||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
export const NoteCmd = modActionsCmd({
|
||||
trigger: "note",
|
||||
|
|
|
@ -2,14 +2,14 @@ import { Snowflake } from "discord.js";
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { clearExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { AuditLogEvent, User } from "discord.js";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
|
||||
/**
|
||||
* Create a BAN case automatically when a user is banned manually.
|
||||
|
|
|
@ -3,12 +3,12 @@ import { CaseTypes } from "../../../data/CaseTypes";
|
|||
import { Case } from "../../../data/entities/Case";
|
||||
import { logger } from "../../../logger";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
|
||||
/**
|
||||
* Create a KICK case automatically when a user is kicked manually.
|
||||
|
|
|
@ -2,12 +2,12 @@ import { AuditLogEvent, User } from "discord.js";
|
|||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
|
||||
/**
|
||||
* Create an UNBAN case automatically when a user is unbanned manually.
|
||||
|
|
|
@ -3,7 +3,7 @@ import { GuildPluginData } from "knub";
|
|||
import { hasPermission } from "knub/dist/helpers";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DAYS, SECONDS, errorMessage, resolveMember, resolveUser } from "../../../utils";
|
||||
import { DAYS, errorMessage, resolveMember, resolveUser, SECONDS } from "../../../utils";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { DiscordAPIError, Snowflake, User } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
import { logger } from "../../../logger";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import {
|
||||
|
@ -15,12 +15,12 @@ import {
|
|||
ucfirst,
|
||||
UserNotificationResult,
|
||||
} from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
|
||||
/**
|
||||
* Ban the specified user id, whether or not they're actually on the server at the time. Generates a case.
|
||||
|
|
|
@ -5,14 +5,14 @@ import moment from "moment-timezone";
|
|||
import { LogType } from "src/data/LogType";
|
||||
import { logger } from "src/logger";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Tempban } from "../../../data/entities/Tempban";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { isBanned } from "./isBanned";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { Tempban } from "../../../data/entities/Tempban";
|
||||
|
||||
export async function clearTempban(pluginData: GuildPluginData<ModActionsPluginType>, tempban: Tempban) {
|
||||
if (!(await isBanned(pluginData, tempban.user_id))) {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { GuildMember } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
/**
|
||||
* Kick the specified server member. Generates a case.
|
||||
|
|
|
@ -3,8 +3,8 @@ import { CaseTypes } from "../../../data/CaseTypes";
|
|||
import { Case } from "../../../data/entities/Case";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
|
||||
export async function updateCase(pluginData, msg: Message, args) {
|
||||
let theCase: Case | undefined;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { renderTemplate, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ModActionsPluginType, WarnOptions, WarnResult } from "../types";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
|
||||
export async function warnMember(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { GuildTextBasedChannel } from "discord.js";
|
||||
import { EventEmitter } from "events";
|
||||
import * as t from "io-ts";
|
||||
import { BasePluginType, guildPluginMessageCommand, guildPluginEventListener } from "knub";
|
||||
import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue