mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
only call disableInvites()
if value has changed (#443)
This commit is contained in:
parent
f58e7f5eb7
commit
47ad8fa4d3
1 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import { GuildFeature } from "discord.js";
|
||||||
import * as t from "io-ts";
|
import * as t from "io-ts";
|
||||||
import { automodAction } from "../helpers";
|
import { automodAction } from "../helpers";
|
||||||
|
|
||||||
|
@ -9,6 +10,10 @@ export const PauseInvitesAction = automodAction({
|
||||||
defaultConfig: {},
|
defaultConfig: {},
|
||||||
|
|
||||||
async apply({ pluginData, actionConfig }) {
|
async apply({ pluginData, actionConfig }) {
|
||||||
await pluginData.guild.disableInvites(actionConfig.paused);
|
const hasInvitesDisabled = pluginData.guild.features.includes(GuildFeature.InvitesDisabled);
|
||||||
|
|
||||||
|
if (actionConfig.paused !== hasInvitesDisabled) {
|
||||||
|
await pluginData.guild.disableInvites(actionConfig.paused);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue