Example #1
0
        public async Task Send(Message message, MessageHandlerModule module)
        {
            switch (module)
            {
            case MessengerApi _:
                await messageHandler.Receive(message);

                break;

            case MessageHandlerModule _:
                await messengers[message.User.MessengerClass].Receive(message);
                break;
            }
        }
Example #2
0
 internal void SetStateMachine(MessageHandlerModule stateMachine)
 {
     this.messageHandler = stateMachine;
 }
Example #3
0
 internal void SetMessageStateMachine(MessageHandlerModule messageStateMachine)
 {
     this.messageHandler = messageStateMachine;
 }
Example #4
0
 public BotMediator(IMusicTrackDatabase musicDatabase)
 {
     this.messengers     = new Dictionary <string, MessengerApi>();
     this.messageHandler = new MessageStateMachine(musicDatabase);
     this.messageHandler.SetMediator(this);
 }