Automod work vol 2
This commit is contained in:
parent
f657b169df
commit
0e9f65e0d5
12 changed files with 420 additions and 59 deletions
backend/src/plugins/Automod/functions
|
@ -14,18 +14,15 @@ const MessageSpamTriggerConfig = t.type({
|
|||
});
|
||||
type TMessageSpamTriggerConfig = t.TypeOf<typeof MessageSpamTriggerConfig>;
|
||||
|
||||
const MessageSpamMatchResultType = t.type({
|
||||
archiveId: t.string,
|
||||
});
|
||||
type TMessageSpamMatchResultType = t.TypeOf<typeof MessageSpamMatchResultType>;
|
||||
interface TMessageSpamMatchResultType {
|
||||
archiveId: string;
|
||||
}
|
||||
|
||||
export function createMessageSpamTrigger(spamType: RecentActionType, prettyName: string) {
|
||||
return automodTrigger({
|
||||
return automodTrigger<TMessageSpamMatchResultType>()({
|
||||
configType: MessageSpamTriggerConfig,
|
||||
defaultConfig: {},
|
||||
|
||||
matchResultType: MessageSpamMatchResultType,
|
||||
|
||||
async match({ pluginData, context, triggerConfig }) {
|
||||
if (!context.message) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue