File tree Expand file tree Collapse file tree
backend/src/plugins/Automod/triggers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ const configSchema = z.strictObject({
1515 exclude_guilds : z . array ( zSnowflake ) . max ( 255 ) . optional ( ) ,
1616 include_invite_codes : z . array ( z . string ( ) . max ( 32 ) ) . max ( 255 ) . optional ( ) ,
1717 exclude_invite_codes : z . array ( z . string ( ) . max ( 32 ) ) . max ( 255 ) . optional ( ) ,
18+ include_custom_invite_codes : z . array ( z . string ( ) . max ( 32 ) ) . max ( 255 ) . transform ( arr => arr . map ( str => str . toLowerCase ( ) ) ) . optional ( ) ,
19+ exclude_custom_invite_codes : z . array ( z . string ( ) . max ( 32 ) ) . max ( 255 ) . transform ( arr => arr . map ( str => str . toLowerCase ( ) ) ) . optional ( ) ,
1820 allow_group_dm_invites : z . boolean ( ) . default ( false ) ,
1921 match_messages : z . boolean ( ) . default ( true ) ,
2022 match_embeds : z . boolean ( ) . default ( false ) ,
@@ -45,6 +47,12 @@ export const MatchInvitesTrigger = automodTrigger<MatchResultType>()({
4547 if ( trigger . exclude_invite_codes && ! trigger . exclude_invite_codes . includes ( code ) ) {
4648 return { extra : { type, code } } ;
4749 }
50+ if ( trigger . include_custom_invite_codes && trigger . include_custom_invite_codes . includes ( code . toLowerCase ( ) ) ) {
51+ return { extra : { type, code } } ;
52+ }
53+ if ( trigger . exclude_custom_invite_codes && ! trigger . exclude_custom_invite_codes . includes ( code . toLowerCase ( ) ) ) {
54+ return { extra : { type, code } } ;
55+ }
4856 }
4957
5058 for ( const code of uniqueInviteCodes ) {
You can’t perform that action at this time.
0 commit comments