@@ -23,6 +23,7 @@ public class FritzBot : IHostedService
23
23
private readonly IChatService [ ] _chatServices ;
24
24
private readonly IBasicCommand [ ] _basicCommands ;
25
25
private readonly IExtendedCommand [ ] _extendedCommands ;
26
+ private readonly string [ ] _OtherBots ;
26
27
27
28
private readonly ConcurrentDictionary < string , ChatUserInfo > _activeUsers = new ConcurrentDictionary < string , ChatUserInfo > ( ) ;
28
29
private readonly ConcurrentDictionary < string , DateTime > _commandExecutedTimeMap = new ConcurrentDictionary < string , DateTime > ( ) ;
@@ -51,6 +52,8 @@ public FritzBot(IConfiguration configuration, IServiceProvider serviceProvider,
51
52
var cooldownConfig = configuration [ $ "{ ConfigurationRoot } :CooldownTime"] ;
52
53
CooldownTime = ! string . IsNullOrEmpty ( cooldownConfig ) ? TimeSpan . Parse ( cooldownConfig ) : TimeSpan . Zero ;
53
54
55
+ _OtherBots = String . IsNullOrEmpty ( configuration [ $ "{ ConfigurationRoot } :Otherbots"] ) ? new [ ] { "nightbot" , "fritzbot" , "streamelements" , "pretzelrocks" } : configuration [ $ "{ ConfigurationRoot } :Otherbots"] . Split ( ',' ) ;
56
+
54
57
_logger ? . LogInformation ( "Command cooldown set to {0}" , CooldownTime ) ;
55
58
}
56
59
@@ -143,8 +146,8 @@ private async Task ProcessChatMessage(object sender, ChatMessageEventArgs chatMe
143
146
{
144
147
145
148
// 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 ( ) ) )
148
151
{
149
152
SentimentSink . RecentChatMessages . Enqueue ( chatMessageArgs . Message ) ;
150
153
}
0 commit comments