File tree 2 files changed +37
-3
lines changed
2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change 158
158
< a class ="spam-name "> Inline Links</ a >
159
159
< div class ="grid-row ">
160
160
< p > Blocks links that show custom text and hide the actual link.</ p >
161
-
161
+ < div class ="setting ">
162
+ < div class ="title-with-setting ">
163
+ < input type ="checkbox " id ="filter-disguised-only ">
164
+ Disguised URLs only
165
+ </ div >
166
+ < p > When enabled, it will only block inline links that appear as a domain. For example: [example.com](treeben77.xyz)</ p >
167
+ </ div >
162
168
< div class ="regex-results ">
163
169
< button class ="copy-regex " id ="copy-regex-inline-links "> Copy</ button >
164
170
< a class ="regex-output " id ="regex-output-inline-links ">
167
173
</ div >
168
174
</ div >
169
175
</ div >
176
+ < div class ="spam-type " id ="subtext ">
177
+ < a class ="spam-name "> Subtext</ a >
178
+ < div class ="grid-row ">
179
+ < p > Blocks messages which contain subtext, which is smaller text that may be used to create convincing fake offical Discord notices.</ p >
180
+
181
+ < div class ="regex-results ">
182
+ < button class ="copy-regex " id ="copy-regex-subtext "> Copy</ button >
183
+ < a class ="regex-output " id ="regex-output-subtext ">
184
+ h[e3]ll[o0] w[o0]rld
185
+ </ a >
186
+ </ div >
187
+ </ div >
188
+ </ div >
170
189
< div class ="spam-type " id ="email-address ">
171
190
< a class ="spam-name "> Email Addresses</ a >
172
191
< div class ="grid-row ">
Original file line number Diff line number Diff line change @@ -74,7 +74,22 @@ const regex_types = [
74
74
copy_btn : document . getElementById ( "copy-regex-inline-links" ) ,
75
75
output : document . getElementById ( "regex-output-inline-links" ) ,
76
76
generator : function ( settings ) {
77
- return `\\[.*\\n*.*\\]\\(\\s*<?(?:https?://)?[a-z0-9_\\-\\.]*[a-z0-9_\\-]+\\.[a-z]{2,}.*>?\\s*\\)`
77
+ if ( settings . disguisedonly . checked ) {
78
+ return `\\[.*[a-z0-9_\\-]+\\.[a-z]{2,}[\\/]?.*\\]\\(<?(?:https?://)?[a-z0-9_\\-\\.]*[a-z0-9_\\-]+\\.[a-z]{2,}.*>?\\)`
79
+ } else {
80
+ return `\\[.*\\n*.*\\]\\(\\s*<?(?:https?://)?[a-z0-9_\\-\\.]*[a-z0-9_\\-]+\\.[a-z]{2,}.*>?\\s*\\)`
81
+ } ;
82
+ } ,
83
+ setting_elements : {
84
+ disguisedonly : document . getElementById ( "filter-disguised-only" )
85
+ }
86
+ } ,
87
+ {
88
+ name : "subtext" ,
89
+ copy_btn : document . getElementById ( "copy-regex-subtext" ) ,
90
+ output : document . getElementById ( "regex-output-subtext" ) ,
91
+ generator : function ( settings ) {
92
+ return `(?m)^-#\\s.*$`
78
93
} ,
79
94
setting_elements : { }
80
95
} ,
@@ -108,7 +123,7 @@ const regex_types = [
108
123
if ( settings . slider . value == 2 ) {
109
124
return `^#\\s.*$` ;
110
125
} else {
111
- return `^#{1,${ settings . slider . value - 1 } }\\s.*$` ;
126
+ return `^(> )? #{1,${ settings . slider . value - 1 } }\\s.*$` ;
112
127
}
113
128
} ,
114
129
setting_elements : {
You can’t perform that action at this time.
0 commit comments