@@ -200,21 +200,21 @@ export class Bot {
200200 const eventSub =
201201 process . env . NODE_ENV === 'development'
202202 ? new EventSubHttpListener ( {
203- apiClient : apiClient ,
204- adapter : new NgrokAdapter ( {
205- ngrokConfig : {
206- authtoken : process . env . NGROK_AUTH_TOKEN ?? '' ,
207- } ,
208- } ) ,
209- logger : { minLevel : 'debug' } ,
210- secret :
211- process . env . EVENTSUB_SECRET ??
212- 'thisShouldBeARandomlyGeneratedFixedString' ,
213- } )
203+ apiClient : apiClient ,
204+ adapter : new NgrokAdapter ( {
205+ ngrokConfig : {
206+ authtoken : process . env . NGROK_AUTH_TOKEN ?? '' ,
207+ } ,
208+ } ) ,
209+ logger : { minLevel : 'debug' } ,
210+ secret :
211+ process . env . EVENTSUB_SECRET ??
212+ 'thisShouldBeARandomlyGeneratedFixedString' ,
213+ } )
214214 : new EventSubWsListener ( {
215- apiClient : apiClient ,
216- logger : { minLevel : 'info' } ,
217- } )
215+ apiClient : apiClient ,
216+ logger : { minLevel : 'info' } ,
217+ } )
218218
219219 return new Bot ( chatClient , authProvider , apiClient , eventSub )
220220 }
@@ -330,8 +330,17 @@ export class Bot {
330330 command . execute ( event , commandNames , this . apiClient )
331331 break
332332 case 'permit' :
333+ // if not a broadcaster or mod, do nothing
334+ if ( ! isMod && ! isBroadcaster ) {
335+ return
336+ }
337+
333338 // add to permit list ahead of time
334- const username = args [ 0 ]
339+ let username = args [ 0 ]
340+ if ( username . startsWith ( '@' ) ) {
341+ username = username . slice ( 1 )
342+ args [ 0 ] = username
343+ }
335344 const permitId = setTimeout ( ( ) => {
336345 this . permitList . delete ( username )
337346 log . bot . info ( `Removed ${ username } from permit list` )
@@ -394,7 +403,12 @@ export class Bot {
394403 isBot ,
395404 )
396405 } else if ( findUrl ( event . messageText ) . length > 0 ) {
397- if ( isBroadcaster || isMod || isBot ) {
406+ if (
407+ isBroadcaster ||
408+ isMod ||
409+ isBot ||
410+ this . permitList . has ( authorInfo . displayName )
411+ ) {
398412 return
399413 }
400414
0 commit comments