mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
Organise all imports, make Mutes depend on Logs
This commit is contained in:
parent
a94e7593ec
commit
6ac9d2f2a2
437 changed files with 1912 additions and 2027 deletions
|
@ -1,33 +1,32 @@
|
|||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ConfigSchema, CountersPluginType, TTrigger } from "./types";
|
||||
import { EventEmitter } from "events";
|
||||
import { PluginOptions } from "knub";
|
||||
import { ConfigPreprocessorFn } from "knub/dist/config/configTypes";
|
||||
import {
|
||||
buildCounterConditionString,
|
||||
CounterTrigger,
|
||||
getReverseCounterComparisonOp,
|
||||
parseCounterConditionString
|
||||
} from "../../data/entities/CounterTrigger";
|
||||
import { GuildCounters } from "../../data/GuildCounters";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { changeCounterValue } from "./functions/changeCounterValue";
|
||||
import { setCounterValue } from "./functions/setCounterValue";
|
||||
import { convertDelayStringToMS, MINUTES, SECONDS } from "../../utils";
|
||||
import { EventEmitter } from "events";
|
||||
import { onCounterEvent } from "./functions/onCounterEvent";
|
||||
import { offCounterEvent } from "./functions/offCounterEvent";
|
||||
import { emitCounterEvent } from "./functions/emitCounterEvent";
|
||||
import { ConfigPreprocessorFn } from "knub/dist/config/configTypes";
|
||||
import { decayCounter } from "./functions/decayCounter";
|
||||
import { convertDelayStringToMS, MINUTES } from "../../utils";
|
||||
import { StrictValidationError } from "../../validatorUtils";
|
||||
import { PluginOptions } from "knub";
|
||||
import { ViewCounterCmd } from "./commands/ViewCounterCmd";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { AddCounterCmd } from "./commands/AddCounterCmd";
|
||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||
import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd";
|
||||
import { ResetCounterCmd } from "./commands/ResetCounterCmd";
|
||||
import { SetCounterCmd } from "./commands/SetCounterCmd";
|
||||
import {
|
||||
buildCounterConditionString,
|
||||
CounterTrigger,
|
||||
getReverseCounterComparisonOp,
|
||||
parseCounterConditionString,
|
||||
} from "../../data/entities/CounterTrigger";
|
||||
import { ViewCounterCmd } from "./commands/ViewCounterCmd";
|
||||
import { changeCounterValue } from "./functions/changeCounterValue";
|
||||
import { counterExists } from "./functions/counterExists";
|
||||
import { decayCounter } from "./functions/decayCounter";
|
||||
import { getPrettyNameForCounter } from "./functions/getPrettyNameForCounter";
|
||||
import { getPrettyNameForCounterTrigger } from "./functions/getPrettyNameForCounterTrigger";
|
||||
import { counterExists } from "./functions/counterExists";
|
||||
import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd";
|
||||
import { CountersListCmd } from "./commands/CountersListCmd";
|
||||
import { ResetCounterCmd } from "./commands/ResetCounterCmd";
|
||||
import { offCounterEvent } from "./functions/offCounterEvent";
|
||||
import { onCounterEvent } from "./functions/onCounterEvent";
|
||||
import { setCounterValue } from "./functions/setCounterValue";
|
||||
import { ConfigSchema, CountersPluginType, TTrigger } from "./types";
|
||||
|
||||
const MAX_COUNTERS = 5;
|
||||
const MAX_TRIGGERS_PER_COUNTER = 5;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { TextChannel } from "discord.js";
|
||||
import { typedGuildCommand } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { changeCounterValue } from "../functions/changeCounterValue";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
|
||||
export const AddCounterCmd = typedGuildCommand<CountersPluginType>()({
|
||||
trigger: ["counters add", "counter add", "addcounter"],
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { typedGuildCommand } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { trimMultilineString, ucfirst } from "../../../utils";
|
||||
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
export const CountersListCmd = typedGuildCommand<CountersPluginType>()({
|
||||
trigger: ["counters list", "counter list", "counters"],
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import { typedGuildCommand } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
|
||||
import { confirm, MINUTES, noop, trimMultilineString } from "../../../utils";
|
||||
import { confirm, noop, trimMultilineString } from "../../../utils";
|
||||
import { resetAllCounterValues } from "../functions/resetAllCounterValues";
|
||||
import { counterIdLock } from "../../../utils/lockNameHelpers";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
|
||||
export const ResetAllCounterValuesCmd = typedGuildCommand<CountersPluginType>()({
|
||||
trigger: ["counters reset_all"],
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { TextChannel } from "discord.js";
|
||||
import { typedGuildCommand } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { setCounterValue } from "../functions/setCounterValue";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
|
||||
export const ResetCounterCmd = typedGuildCommand<CountersPluginType>()({
|
||||
trigger: ["counters reset", "counter reset", "resetcounter"],
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { TextChannel } from "discord.js";
|
||||
import { typedGuildCommand } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { setCounterValue } from "../functions/setCounterValue";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
|
||||
export const SetCounterCmd = typedGuildCommand<CountersPluginType>()({
|
||||
trigger: ["counters set", "counter set", "setcounter"],
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { TextChannel } from "discord.js";
|
||||
import { typedGuildCommand } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { waitForReply } from "knub/dist/helpers";
|
||||
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
|
||||
export const ViewCounterCmd = typedGuildCommand<CountersPluginType>()({
|
||||
trigger: ["counters view", "counter view", "viewcounter", "counter"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { CounterTrigger } from "../../../data/entities/CounterTrigger";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { emitCounterEvent } from "./emitCounterEvent";
|
||||
|
||||
export async function checkAllValuesForReverseTrigger(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { CounterTrigger } from "../../../data/entities/CounterTrigger";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { emitCounterEvent } from "./emitCounterEvent";
|
||||
|
||||
export async function checkAllValuesForTrigger(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { CounterTrigger } from "../../../data/entities/CounterTrigger";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { emitCounterEvent } from "./emitCounterEvent";
|
||||
|
||||
export async function checkCounterTrigger(
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { CounterTrigger } from "../../../data/entities/CounterTrigger";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { emitCounterEvent } from "./emitCounterEvent";
|
||||
|
||||
export async function checkReverseCounterTrigger(
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { checkAllValuesForTrigger } from "./checkAllValuesForTrigger";
|
||||
import { checkAllValuesForReverseTrigger } from "./checkAllValuesForReverseTrigger";
|
||||
import { counterIdLock } from "../../../utils/lockNameHelpers";
|
||||
import { CountersPluginType } from "../types";
|
||||
import { checkAllValuesForReverseTrigger } from "./checkAllValuesForReverseTrigger";
|
||||
import { checkAllValuesForTrigger } from "./checkAllValuesForTrigger";
|
||||
|
||||
export async function decayCounter(
|
||||
pluginData: GuildPluginData<CountersPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CounterEvents, CountersPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CounterEvents, CountersPluginType } from "../types";
|
||||
|
||||
export function emitCounterEvent<TEvent extends keyof CounterEvents>(
|
||||
pluginData: GuildPluginData<CountersPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CountersPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType } from "../types";
|
||||
|
||||
export function getPrettyNameForCounter(pluginData: GuildPluginData<CountersPluginType>, counterName: string) {
|
||||
const config = pluginData.config.get();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CountersPluginType, TTrigger } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CountersPluginType, TTrigger } from "../types";
|
||||
|
||||
export function getPrettyNameForCounterTrigger(
|
||||
pluginData: GuildPluginData<CountersPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CounterEventEmitter, CountersPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CounterEventEmitter, CountersPluginType } from "../types";
|
||||
|
||||
export function offCounterEvent(
|
||||
pluginData: GuildPluginData<CountersPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { CounterEvents, CountersPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CounterEvents, CountersPluginType } from "../types";
|
||||
|
||||
export function onCounterEvent<TEvent extends keyof CounterEvents>(
|
||||
pluginData: GuildPluginData<CountersPluginType>,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { EventEmitter } from "events";
|
||||
import * as t from "io-ts";
|
||||
import { BasePluginType } from "knub";
|
||||
import { CounterTrigger } from "../../data/entities/CounterTrigger";
|
||||
import { GuildCounters } from "../../data/GuildCounters";
|
||||
import { tDelayString, tNullable } from "../../utils";
|
||||
import { EventEmitter } from "events";
|
||||
import { CounterTrigger } from "../../data/entities/CounterTrigger";
|
||||
import Timeout = NodeJS.Timeout;
|
||||
|
||||
export const Trigger = t.type({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue