@@ -9,16 +9,14 @@ public class ChanServCommand : ICommand
99
1010 public ( bool handled , string response ) Process ( BotContext ctx , string senderNick , string message , string fullLine )
1111 {
12- if ( ! message . StartsWith ( "!blist" ) && ! message . StartsWith ( "!addban" ) &&
13- ! message . StartsWith ( "!delban" ) && ! message . StartsWith ( "!tb" ) )
12+ // !blist is Discord-only, handled via ProcessDiscord
13+ // Only allow !addban, !delban, !tb from IRC
14+ if ( ! message . StartsWith ( "!addban" ) && ! message . StartsWith ( "!delban" ) && ! message . StartsWith ( "!tb" ) )
1415 return ( false , null ) ;
1516
1617 if ( ! ctx . Admins . Contains ( senderNick ) )
1718 return ( true , "You must be an admin to use ChanServ commands." ) ;
1819
19- if ( message . StartsWith ( "!blist" ) )
20- return HandleBanList ( ctx , senderNick , false ) ;
21-
2220 if ( message . StartsWith ( "!addban" ) )
2321 return HandleAddBan ( ctx , senderNick , message ) ;
2422
@@ -33,6 +31,7 @@ public class ChanServCommand : ICommand
3331
3432 public ( bool handled , string response ) ProcessDiscord ( BotContext ctx , string senderNick , string message )
3533 {
34+ // Discord can use !blist and other commands
3635 if ( ! message . StartsWith ( "!blist" ) && ! message . StartsWith ( "!addban" ) &&
3736 ! message . StartsWith ( "!delban" ) && ! message . StartsWith ( "!tb" ) )
3837 return ( false , null ) ;
@@ -57,10 +56,10 @@ public class ChanServCommand : ICommand
5756
5857 private ( bool , string ) HandleBanList ( BotContext ctx , string senderNick , bool isDiscord )
5958 {
60- string commandId = $ "blist_{ DateTime . UtcNow . Ticks } ";
59+ string commandId = $ "blist_{ DateTime . UtcNow . Ticks } _ { senderNick } ";
6160 ctx . TrackServiceRequest ( commandId , senderNick , isDiscord ) ;
6261 ctx . Writer ? . WriteLine ( $ "PRIVMSG ChanServ :bans { ctx . Channel } ") ;
63- ctx . Logger ? . Log ( $ "[CHANSERV] { senderNick } requested banlist for { ctx . Channel } (ID: { commandId } )") ;
62+ ctx . Logger ? . Log ( $ "[CHANSERV] { senderNick } requested banlist for { ctx . Channel } (ID: { commandId } ) - Discord: { isDiscord } ") ;
6463 return ( false , null ) ;
6564 }
6665
@@ -110,3 +109,4 @@ public class ChanServCommand : ICommand
110109
111110
112111
112+
0 commit comments