@@ -23,6 +23,7 @@ public class FritzBot : IHostedService
2323 private readonly IChatService [ ] _chatServices ;
2424 private readonly IBasicCommand [ ] _basicCommands ;
2525 private readonly IExtendedCommand [ ] _extendedCommands ;
26+ private readonly string [ ] _OtherBots ;
2627
2728 private readonly ConcurrentDictionary < string , ChatUserInfo > _activeUsers = new ConcurrentDictionary < string , ChatUserInfo > ( ) ;
2829 private readonly ConcurrentDictionary < string , DateTime > _commandExecutedTimeMap = new ConcurrentDictionary < string , DateTime > ( ) ;
@@ -51,6 +52,8 @@ public FritzBot(IConfiguration configuration, IServiceProvider serviceProvider,
5152 var cooldownConfig = configuration [ $ "{ ConfigurationRoot } :CooldownTime"] ;
5253 CooldownTime = ! string . IsNullOrEmpty ( cooldownConfig ) ? TimeSpan . Parse ( cooldownConfig ) : TimeSpan . Zero ;
5354
55+ _OtherBots = String . IsNullOrEmpty ( configuration [ $ "{ ConfigurationRoot } :Otherbots"] ) ? new [ ] { "nightbot" , "fritzbot" , "streamelements" , "pretzelrocks" } : configuration [ $ "{ ConfigurationRoot } :Otherbots"] . Split ( ',' ) ;
56+
5457 _logger ? . LogInformation ( "Command cooldown set to {0}" , CooldownTime ) ;
5558 }
5659
@@ -143,8 +146,8 @@ private async Task ProcessChatMessage(object sender, ChatMessageEventArgs chatMe
143146 {
144147
145148 // TODO: Capture and transmit the user who sent the message
146- var otherBots = new [ ] { "nightbot" , "fritzbot" , "streamelements" } ;
147- if ( ! otherBots . Contains ( chatMessageArgs . UserName . ToLowerInvariant ( ) ) )
149+ // var otherBots = new[] { "nightbot", "fritzbot", "streamelements", "pretzelrocks " };
150+ if ( ! _OtherBots . Contains ( chatMessageArgs . UserName . ToLowerInvariant ( ) ) )
148151 {
149152 SentimentSink . RecentChatMessages . Enqueue ( chatMessageArgs . Message ) ;
150153 }
0 commit comments