mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-25 10:25:01 +00:00
Update ModActionsPlugin.ts
This commit is contained in:
parent
2464ddb270
commit
aeab0b5055
1 changed files with 12 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { GuildMember, Message, Snowflake } from "discord.js";
|
import { GuildMember, Message, PartialUser, Snowflake, User } from "discord.js";
|
||||||
import { EventEmitter } from "events";
|
import { EventEmitter } from "events";
|
||||||
import { GuildCases } from "../../data/GuildCases";
|
import { GuildCases } from "../../data/GuildCases";
|
||||||
import { GuildLogs } from "../../data/GuildLogs";
|
import { GuildLogs } from "../../data/GuildLogs";
|
||||||
|
@ -6,7 +6,7 @@ import { GuildMutes } from "../../data/GuildMutes";
|
||||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||||
import { mapToPublicFn } from "../../pluginUtils";
|
import { mapToPublicFn } from "../../pluginUtils";
|
||||||
import { Queue } from "../../Queue";
|
import { Queue } from "../../Queue";
|
||||||
import { MINUTES, trimPluginDescription } from "../../utils";
|
import { MINUTES, trimPluginDescription, UnknownUser } from "../../utils";
|
||||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||||
|
@ -25,6 +25,7 @@ import { KickCmd } from "./commands/KickCmd";
|
||||||
import { MassbanCmd } from "./commands/MassBanCmd";
|
import { MassbanCmd } from "./commands/MassBanCmd";
|
||||||
import { MassmuteCmd } from "./commands/MassmuteCmd";
|
import { MassmuteCmd } from "./commands/MassmuteCmd";
|
||||||
import { MassunbanCmd } from "./commands/MassUnbanCmd";
|
import { MassunbanCmd } from "./commands/MassUnbanCmd";
|
||||||
|
import { MassWarnCmd } from "./commands/MassWarnCmd";
|
||||||
import { MuteCmd } from "./commands/MuteCmd";
|
import { MuteCmd } from "./commands/MuteCmd";
|
||||||
import { NoteCmd } from "./commands/NoteCmd";
|
import { NoteCmd } from "./commands/NoteCmd";
|
||||||
import { SoftbanCmd } from "./commands/SoftbanCommand";
|
import { SoftbanCmd } from "./commands/SoftbanCommand";
|
||||||
|
@ -80,10 +81,12 @@ const defaultOptions = {
|
||||||
can_massunban: false,
|
can_massunban: false,
|
||||||
can_massban: false,
|
can_massban: false,
|
||||||
can_massmute: false,
|
can_massmute: false,
|
||||||
|
can_masswarn: false,
|
||||||
can_hidecase: false,
|
can_hidecase: false,
|
||||||
can_deletecase: false,
|
can_deletecase: false,
|
||||||
can_act_as_other: false,
|
can_act_as_other: false,
|
||||||
create_cases_for_manual_actions: true,
|
create_cases_for_manual_actions: true,
|
||||||
|
reason_aliases: {},
|
||||||
},
|
},
|
||||||
overrides: [
|
overrides: [
|
||||||
{
|
{
|
||||||
|
@ -105,6 +108,7 @@ const defaultOptions = {
|
||||||
can_massunban: true,
|
can_massunban: true,
|
||||||
can_massban: true,
|
can_massban: true,
|
||||||
can_massmute: true,
|
can_massmute: true,
|
||||||
|
can_masswarn: true,
|
||||||
can_hidecase: true,
|
can_hidecase: true,
|
||||||
can_act_as_other: true,
|
can_act_as_other: true,
|
||||||
},
|
},
|
||||||
|
@ -144,6 +148,7 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
||||||
MassbanCmd,
|
MassbanCmd,
|
||||||
MassmuteCmd,
|
MassmuteCmd,
|
||||||
MassunbanCmd,
|
MassunbanCmd,
|
||||||
|
MassWarnCmd,
|
||||||
AddCaseCmd,
|
AddCaseCmd,
|
||||||
CaseCmd,
|
CaseCmd,
|
||||||
CasesUserCmd,
|
CasesUserCmd,
|
||||||
|
@ -155,8 +160,8 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
||||||
|
|
||||||
public: {
|
public: {
|
||||||
warnMember(pluginData) {
|
warnMember(pluginData) {
|
||||||
return (member: GuildMember, reason: string, warnOptions?: WarnOptions) => {
|
return (reason: string, member: GuildMember | null, user?: User | null, warnOptions?: WarnOptions) => {
|
||||||
warnMember(pluginData, member, reason, warnOptions);
|
warnMember(pluginData, reason, member, user, warnOptions);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -205,6 +210,9 @@ export const ModActionsPlugin = zeppelinGuildPlugin<ModActionsPluginType>()({
|
||||||
// so we're giving each massban 15 minutes to complete before launching the next massban
|
// so we're giving each massban 15 minutes to complete before launching the next massban
|
||||||
state.massbanQueue = new Queue(15 * MINUTES);
|
state.massbanQueue = new Queue(15 * MINUTES);
|
||||||
|
|
||||||
|
// Same goes for masswarns, since they have to send a lot of DMs
|
||||||
|
state.masswarnQueue = new Queue(15 * MINUTES);
|
||||||
|
|
||||||
state.events = new EventEmitter();
|
state.events = new EventEmitter();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue