File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
RealTimeWeatherMonitoringApp Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,12 @@ namespace RealTimeWeatherMonitoringApp.Domain.Common;
22
33public class BotEventArgs : EventArgs
44{
5+ public string BotName { get ; }
56 public string Message { get ; }
6- public BotEventArgs ( string message ) => Message = message ;
7+
8+ public BotEventArgs ( string botName , string message )
9+ {
10+ BotName = botName ;
11+ Message = message ;
12+ }
713}
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class BotController<TEvaluated> : IBotController<TEvaluated>
99 public BotController ( Bot < TEvaluated > bot ) => _bot = bot ;
1010
1111 public BotEventArgs ? React ( DataChangeEventArgs < TEvaluated > args ) =>
12- args . NewData != null && IsTriggeredBy ( args . NewData ) ? new BotEventArgs ( _bot . Message ) : null ;
12+ args . NewData != null && IsTriggeredBy ( args . NewData ) ? new BotEventArgs ( _bot . Name , _bot . Message ) : null ;
1313
1414 private bool IsTriggeredBy ( TEvaluated data ) => _bot . Enabled && _bot . Evaluator . Evaluate ( data ) ;
1515}
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ public class UserController
1616
1717 public void Start ( )
1818 {
19- BotNotificationService . OnBotNotification += ( _ , args ) => Console . WriteLine ( args . Message ) ;
19+ BotNotificationService . OnBotNotification += ( _ , args ) =>
20+ Console . WriteLine ( $ "\n { args . BotName } : { args . Message } ") ;
2021
2122 while ( true )
2223 {
You can’t perform that action at this time.
0 commit comments