@@ -106,12 +106,6 @@ export default function WebhookTool() {
106106 const [ useSpam , setUseSpam ] = useState ( false ) ;
107107 const spamRef = useRef < { stop : boolean } > ( { stop : false } ) ;
108108
109- const isValidWebhook = ( url : string ) => {
110- const regex =
111- / h t t p s : \/ \/ (?: c a n a r y \. ) ? (?: p t b \. ) ? d i s c o r d (?: a p p ) ? \. c o m \/ a p i \/ w e b h o o k s \/ / ;
112- return regex . test ( url ) ;
113- } ;
114-
115109 useEffect ( ( ) => {
116110 const saved = localStorage . getItem ( "savedWebhooks" ) ;
117111 if ( saved ) {
@@ -163,13 +157,6 @@ export default function WebhookTool() {
163157 } ;
164158
165159 const editWebhook = async ( ) => {
166- if ( ! isValidWebhook ( webhookUrl ) ) {
167- toast . error ( "Error" , {
168- description : "Please enter a valid Discord webhook URL" ,
169- } ) ;
170- return ;
171- }
172-
173160 setLoading ( true ) ;
174161
175162 try {
@@ -213,13 +200,6 @@ export default function WebhookTool() {
213200 } ;
214201
215202 const sendWebhook = async ( ) => {
216- if ( ! isValidWebhook ( webhookUrl ) ) {
217- toast . error ( "Error" , {
218- description : "Please enter a valid Discord webhook URL" ,
219- } ) ;
220- return ;
221- }
222-
223203 setLoading ( true ) ;
224204
225205 try {
@@ -288,13 +268,6 @@ export default function WebhookTool() {
288268 } ;
289269
290270 const startSpam = async ( ) => {
291- if ( ! isValidWebhook ( webhookUrl ) ) {
292- toast . error ( "Error" , {
293- description : "Please enter a valid Discord webhook URL" ,
294- } ) ;
295- return ;
296- }
297-
298271 setIsSpamming ( true ) ;
299272 spamRef . current . stop = false ;
300273 const payload : WebhookPayload = { } ;
0 commit comments