mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-22 01:05:02 +00:00
Merge remote-tracking branch 'upstream/master' into feat/mime-checking
This commit is contained in:
commit
64df1909e7
76 changed files with 18894 additions and 4637 deletions
|
@ -73,6 +73,10 @@ const configPreprocessor: ConfigPreprocessorFn<AutomodPluginType> = options => {
|
|||
rule["enabled"] = true;
|
||||
}
|
||||
|
||||
if (rule["allow_further_rules"] == null) {
|
||||
rule["allow_further_rules"] = false;
|
||||
}
|
||||
|
||||
if (rule["affects_bots"] == null) {
|
||||
rule["affects_bots"] = false;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ export const AddRolesAction = automodAction({
|
|||
|
||||
await Promise.all(
|
||||
members.map(async member => {
|
||||
const memberRoles = new Set(member.roles.cache.keyArray());
|
||||
const memberRoles = new Set(member.roles.cache.keys());
|
||||
for (const roleId of rolesToAssign) {
|
||||
memberRoles.add(roleId as Snowflake);
|
||||
ignoreRoleChange(pluginData, member.id, roleId);
|
||||
|
|
|
@ -54,7 +54,7 @@ export const RemoveRolesAction = automodAction({
|
|||
|
||||
await Promise.all(
|
||||
members.map(async member => {
|
||||
const memberRoles = new Set(member.roles.cache.keyArray());
|
||||
const memberRoles = new Set(member.roles.cache.keys());
|
||||
for (const roleId of rolesToRemove) {
|
||||
memberRoles.delete(roleId as Snowflake);
|
||||
ignoreRoleChange(pluginData, member.id, roleId);
|
||||
|
|
|
@ -72,7 +72,7 @@ export async function runAutomod(pluginData: GuildPluginData<AutomodPluginType>,
|
|||
|
||||
matchResult.fullSummary = `Triggered automod rule **${ruleName}**\n${matchResult.summary}`.trim();
|
||||
|
||||
break triggerLoop;
|
||||
if (!rule.allow_further_rules) break triggerLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ export async function runAutomod(pluginData: GuildPluginData<AutomodPluginType>,
|
|||
});
|
||||
}
|
||||
|
||||
break;
|
||||
if (!rule.allow_further_rules) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ export const Rule = t.type({
|
|||
triggers: t.array(t.partial(AvailableTriggers.props)),
|
||||
actions: t.partial(AvailableActions.props),
|
||||
cooldown: tNullable(t.string),
|
||||
allow_further_rules: t.boolean,
|
||||
});
|
||||
export type TRule = t.TypeOf<typeof Rule>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue