chore: fix lint errors; tweak lint rules

This commit is contained in:
Dragory 2023-05-08 22:58:51 +03:00
parent 9b3d6f5d68
commit 5f194bf1ef
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
115 changed files with 176 additions and 264 deletions

View file

@ -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`;
},

View file

@ -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"

View file

@ -30,7 +30,7 @@ export const BanTrigger = automodTrigger<BanTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `User was banned`;
},
});

View file

@ -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
}\``;

View file

@ -29,7 +29,7 @@ export const KickTrigger = automodTrigger<KickTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `User was kicked`;
},
});

View file

@ -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;
}

View file

@ -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 "";
},
});

View file

@ -45,7 +45,7 @@ export const MemberJoinSpamTrigger = automodTrigger<unknown>()({
}
},
renderMatchInformation({ pluginData, contexts, triggerConfig }) {
renderMatchInformation() {
return "";
},
});

View file

@ -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 "";
},
});

View file

@ -29,7 +29,7 @@ export const MuteTrigger = automodTrigger<MuteTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `User was muted`;
},
});

View file

@ -18,7 +18,7 @@ export const NoteTrigger = automodTrigger<NoteTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `Note was added on user`;
},
});

View file

@ -45,7 +45,7 @@ export const ThreadCreateSpamTrigger = automodTrigger<unknown>()({
}
},
renderMatchInformation({ pluginData, contexts, triggerConfig }) {
renderMatchInformation() {
return "";
},
});

View file

@ -18,7 +18,7 @@ export const UnbanTrigger = automodTrigger<UnbanTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `User was unbanned`;
},
});

View file

@ -18,7 +18,7 @@ export const UnmuteTrigger = automodTrigger<UnmuteTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `User was unmuted`;
},
});

View file

@ -29,7 +29,7 @@ export const WarnTrigger = automodTrigger<WarnTriggerResultType>()({
};
},
renderMatchInformation({ matchResult }) {
renderMatchInformation() {
return `User was warned`;
},
});