chore: fix lint errors; tweak lint rules
This commit is contained in:
parent
9b3d6f5d68
commit
5f194bf1ef
115 changed files with 176 additions and 264 deletions
|
@ -2,7 +2,6 @@ import * as t from "io-ts";
|
|||
import { tNullable } from "../../../utils";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
// tslint:disable-next-line
|
||||
interface AntiraidLevelTriggerResult {}
|
||||
|
||||
export const AntiraidLevelTrigger = automodTrigger<AntiraidLevelTriggerResult>()({
|
||||
|
@ -12,7 +11,7 @@ export const AntiraidLevelTrigger = automodTrigger<AntiraidLevelTriggerResult>()
|
|||
|
||||
defaultConfig: {},
|
||||
|
||||
async match({ triggerConfig, context, pluginData }) {
|
||||
async match({ triggerConfig, context }) {
|
||||
if (!context.antiraid) {
|
||||
return;
|
||||
}
|
||||
|
@ -26,7 +25,7 @@ export const AntiraidLevelTrigger = automodTrigger<AntiraidLevelTriggerResult>()
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult, pluginData, contexts, triggerConfig }) {
|
||||
renderMatchInformation({ contexts }) {
|
||||
const newLevel = contexts[0].antiraid!.level;
|
||||
return newLevel ? `Antiraid level was set to ${newLevel}` : `Antiraid was turned off`;
|
||||
},
|
||||
|
|
|
@ -3,7 +3,6 @@ import * as t from "io-ts";
|
|||
import { verboseChannelMention } from "../../../utils";
|
||||
import { automodTrigger } from "../helpers";
|
||||
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
interface AnyMessageResultType {}
|
||||
|
||||
export const AnyMessageTrigger = automodTrigger<AnyMessageResultType>()({
|
||||
|
@ -11,7 +10,7 @@ export const AnyMessageTrigger = automodTrigger<AnyMessageResultType>()({
|
|||
|
||||
defaultConfig: {},
|
||||
|
||||
async match({ pluginData, context, triggerConfig: trigger }) {
|
||||
async match({ context }) {
|
||||
if (!context.message) {
|
||||
return;
|
||||
}
|
||||
|
@ -21,7 +20,7 @@ export const AnyMessageTrigger = automodTrigger<AnyMessageResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ pluginData, contexts, matchResult }) {
|
||||
renderMatchInformation({ pluginData, contexts }) {
|
||||
const channel = pluginData.guild.channels.cache.get(contexts[0].message!.channel_id as Snowflake);
|
||||
return `Matched message (\`${contexts[0].message!.id}\`) in ${
|
||||
channel ? verboseChannelMention(channel) : "Unknown Channel"
|
||||
|
|
|
@ -30,7 +30,7 @@ export const BanTrigger = automodTrigger<BanTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `User was banned`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ export const CounterTrigger = automodTrigger<CounterTriggerResult>()({
|
|||
|
||||
defaultConfig: {},
|
||||
|
||||
async match({ triggerConfig, context, pluginData }) {
|
||||
async match({ triggerConfig, context }) {
|
||||
if (!context.counterTrigger) {
|
||||
return;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ export const CounterTrigger = automodTrigger<CounterTriggerResult>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult, pluginData, contexts, triggerConfig }) {
|
||||
renderMatchInformation({ contexts }) {
|
||||
let str = `Matched counter trigger \`${contexts[0].counterTrigger!.prettyCounter} / ${
|
||||
contexts[0].counterTrigger!.prettyTrigger
|
||||
}\``;
|
||||
|
|
|
@ -29,7 +29,7 @@ export const KickTrigger = automodTrigger<KickTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `User was kicked`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -23,7 +23,7 @@ export const MatchAttachmentTypeTrigger = automodTrigger<MatchResultType>()({
|
|||
whitelist_enabled: false,
|
||||
},
|
||||
|
||||
async match({ pluginData, context, triggerConfig: trigger }) {
|
||||
async match({ context, triggerConfig: trigger }) {
|
||||
if (!context.message) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ export const MemberJoinTrigger = automodTrigger<unknown>()({
|
|||
new_threshold: "1h",
|
||||
},
|
||||
|
||||
async match({ pluginData, context, triggerConfig }) {
|
||||
async match({ context, triggerConfig }) {
|
||||
if (!context.joined || !context.member) {
|
||||
return;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ export const MemberJoinTrigger = automodTrigger<unknown>()({
|
|||
return {};
|
||||
},
|
||||
|
||||
renderMatchInformation({ pluginData, contexts, triggerConfig }) {
|
||||
renderMatchInformation() {
|
||||
return "";
|
||||
},
|
||||
});
|
||||
|
|
|
@ -45,7 +45,7 @@ export const MemberJoinSpamTrigger = automodTrigger<unknown>()({
|
|||
}
|
||||
},
|
||||
|
||||
renderMatchInformation({ pluginData, contexts, triggerConfig }) {
|
||||
renderMatchInformation() {
|
||||
return "";
|
||||
},
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@ export const MemberLeaveTrigger = automodTrigger<unknown>()({
|
|||
|
||||
defaultConfig: {},
|
||||
|
||||
async match({ pluginData, context, triggerConfig }) {
|
||||
async match({ context }) {
|
||||
if (!context.joined || !context.member) {
|
||||
return;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ export const MemberLeaveTrigger = automodTrigger<unknown>()({
|
|||
return {};
|
||||
},
|
||||
|
||||
renderMatchInformation({ pluginData, contexts, triggerConfig }) {
|
||||
renderMatchInformation() {
|
||||
return "";
|
||||
},
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ export const MuteTrigger = automodTrigger<MuteTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `User was muted`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ export const NoteTrigger = automodTrigger<NoteTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `Note was added on user`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -45,7 +45,7 @@ export const ThreadCreateSpamTrigger = automodTrigger<unknown>()({
|
|||
}
|
||||
},
|
||||
|
||||
renderMatchInformation({ pluginData, contexts, triggerConfig }) {
|
||||
renderMatchInformation() {
|
||||
return "";
|
||||
},
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ export const UnbanTrigger = automodTrigger<UnbanTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `User was unbanned`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@ export const UnmuteTrigger = automodTrigger<UnmuteTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `User was unmuted`;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ export const WarnTrigger = automodTrigger<WarnTriggerResultType>()({
|
|||
};
|
||||
},
|
||||
|
||||
renderMatchInformation({ matchResult }) {
|
||||
renderMatchInformation() {
|
||||
return `User was warned`;
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue