public void HandleText(MessageEventArgs eventArgs)
        {
            var msg = eventArgs.msg;

            if (!Utilities.isBotOwner(msg.from))
            {
                Methods.sendReply(msg.chat.id, msg.message_id, "Sorry this bot is not available for general use.");
                return;
            }

            Menu menu = null;

            try
            {
                switch (eventArgs.msg.text)
                {
                case "/menu":
                {
                    menu            = new RootMenu(_sessions, _partialSession != null);
                    _partialSession = null;
                    break;
                }
                }

                if (menu == null && _partialSession != null && _partialSession.WaitingForText())
                {
                    _partialSession.AddText(eventArgs.msg.text);
                    _database.SavePartial(_partialSession);
                    menu = CheckPartialCompletionAndGetNextMenu();
                }

                if (menu == null)
                {
                    foreach (var session in _sessions)
                    {
                        menu = session.HandleMessage(eventArgs.msg);
                        _database.SaveSession(session);
                        if (menu != null)
                        {
                            break;
                        }
                    }
                }
            }
            catch (EnrichmentException ex)
            {
                menu = new EnrichmentExceptionMenu(ex);
            }
            catch (Exception ex)
            {
                menu = new UnknownExceptionMenu(ex);
            }

            menu?.SendReply(eventArgs.msg.chat.id, eventArgs.msg.message_id);
        }
        public void HandleCallback(CallbackEventArgs eventArgs)
        {
            var callback = eventArgs.callbackQuery;

            Logger.LogDebug($"Callback handler: {callback.data}");
            if (!Utilities.isBotOwner(callback.from))
            {
                Methods.sendReply(callback.message.chat.id, callback.message.message_id,
                                  "Sorry this bot is not available for general use.");
                return;
            }

            Methods.answerCallbackQuery(callback.id);
            Menu menu = null;

            try
            {
                switch (callback.data)
                {
                case RootMenu.CallbackName:
                    menu = new RootMenu(_sessions, _partialSession != null);
                    break;

                case StartSessionMenu.CallbackName:
                    menu = new StartSessionMenu(_sessions);
                    break;

                case StopSessionMenu.CallbackName:
                    menu = new StopSessionMenu(_sessions);
                    break;

                case CreateSessionMenu.CallbackName:
                    _partialSession = new PartialSession(callback.message.chat.id);
                    _database.SavePartial(_partialSession);
                    menu = new CreateSessionMenu();
                    break;

                case DeleteSessionMenu.CallBackName:
                    menu = new DeleteSessionMenu(_sessions);
                    break;
                }

                if (callback.data.StartsWith(StartSessionMenu.CallbackName + ":"))
                {
                    menu = StartSession(callback.data);
                }
                else if (callback.data.StartsWith(StopSessionMenu.CallbackName + ":"))
                {
                    menu = StopSession(callback.data);
                }
                else if (callback.data.StartsWith(DeleteSessionMenu.CallBackName + ":"))
                {
                    menu = ConfirmDeleteSession(callback);
                }
                else if (callback.data.StartsWith(DeleteSessionConfirmedMenu.CallbackName + ":"))
                {
                    menu = DeleteSession(callback);
                }
                else if (callback.data.StartsWith(SessionCompleteMenu.LiveSessionCallBackName + ":"))
                {
                    menu = MarkSessionLive(callback);
                }

                if (menu == null && _partialSession != null && _partialSession.WaitingForCallback())
                {
                    _partialSession.AddCallback(callback.data);
                    _database.SavePartial(_partialSession);
                    menu = CheckPartialCompletionAndGetNextMenu();
                }

                if (menu == null)
                {
                    if (callback.data.StartsWith(EnrichmentSession.CallbackName + ":"))
                    {
                        var sessionId        = callback.data.Split(':')[1];
                        var matchingSessions =
                            _sessions.Where(s => s.IsActive && s.Id.ToString().Equals(sessionId)).ToList();
                        foreach (var session in matchingSessions)
                        {
                            session.HandleCallback(callback.data);
                            _database.SaveSession(session);
                        }
                    }
                    else
                    {
                        menu = new UnknownMenu(callback.data);
                    }
                }
            }
            catch (EnrichmentException ex)
            {
                menu = new EnrichmentExceptionMenu(ex, true);
            }
            catch (Exception ex)
            {
                menu = new UnknownExceptionMenu(ex, true);
            }

            menu?.EditMessage(
                callback.message.chat.id,
                callback.message.message_id
                );
        }