Ejemplo n.º 1
0
        public IEnumerable <IOutgoingMessage> ProcessIncomingMessage(IChatSession sess, IIncomingMessage msg)
        {
            var m = new IncomeMessage(sess.ChatId)
            {
                BotEngine = engine,
                BotKey    = key,
                Message   = msg
            };

            bus.Send(m);
            yield break;
        }
        protected override Task Handle(IHandleContext context, InitBotChatMessage message)
        {
            var sp = new StartProcessMessage
            {
                ParentId   = MasterProcessId,
                ProcessId  = ChatProcessIdentity,
                Parameters = DynamicObjectConverters.From(message)
            };

            var m = new IncomeMessage(message.ChatId)
            {
                BotEngine = message.BotEngine,
                BotKey    = message.BotKey,
                Message   = message.Message
            };

            context.SendMessagesSequence(sp, m);

            return(Task.CompletedTask);
        }