mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-19 16:05:01 +00:00
Automod work vol 2
This commit is contained in:
parent
c23f37d991
commit
7113d3953e
12 changed files with 420 additions and 59 deletions
|
@ -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