Esempio n. 1
0
        public IEnumerable <Message> NextState(Message message, RoomSession session)
        {
            List <Message> result = new List <Message>()
            {
            };

            if (isRestartCommand(message))
            {
                var start = new StartSessionState();
                message.Text = "/start";
                var res = start.NextState(message, session);
                result.AddRange(res);
            }
            else
            {
                if (isGetResultCommand(message))
                {
                    if (UserResults.ContainsKey(message.User.name))
                    {
                        result.Add(new Message()
                        {
                            callback_query_id = message.CommandId,
                            show_alert        = true,
                            Text = $"Ты секртеный Санта для @{UserResults[message.User.name]}"
                        });
                    }
                    else
                    {
                        result.Add(new Message()
                        {
                            callback_query_id = message.CommandId,
                            show_alert        = false,
                            Text = $"Ты ж не участвовал плохишь!"
                        });
                    }
                }
            }

            return(result);
        }
Esempio n. 2
0
 public RoomSession(string room)
 {
     Room         = room;
     Selected     = new List <User>();
     SessionState = new StartSessionState();
 }