Esempio n. 1
0
        protected virtual bool TryGoToChild(ISession session, CallbackQuery callbackQuerry)
        {
            int childID = ButtonIdManager.GetIDFromCallbackData(callbackQuerry.Data);

            if (Children.Find((node) => node.Id == childID) is Node child &&
                KeyboardActionsManager.CheckNeeding(message.MetaKeyboard?.CanShowButton(child.Name, session) ?? false,
                                                    message.HaveInlineKeyboard, session, callbackQuerry, child.Name))
            {
                GoToChildNode(session, child);
                return(true);
            }
Esempio n. 2
0
 protected bool TryGoBack(ISession session, Message message)
 {
     if (KeyboardActionsManager.CheckNeeding(needBackButton, this.message.HaveReplyKeyboard, session, message, DefaultStrings.Back))
     {
         session.GoToNode(Parent);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 3
0
 protected bool TryGoBack(ISession session, CallbackQuery callbackQuerry)
 {
     if (KeyboardActionsManager.CheckNeeding(needBackButton, message.HaveInlineKeyboard, session, callbackQuerry, DefaultStrings.Back, () =>
                                             ButtonIdManager.GetIDFromCallbackData(callbackQuerry.Data) == Parent.Id))
     {
         session.GoToNode(Parent);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 4
0
        protected virtual bool TryGoToChild(ISession session, Message message)
        {
            foreach (var child in Children)
            {
                if (KeyboardActionsManager.CheckNeeding(this.message.MetaKeyboard?.CanShowButton(child.Name, session) ?? false,
                                                        this.message.HaveReplyKeyboard, session, message, child.Name))
                {
                    GoToChildNode(session, child);
                    return(true);
                }
            }

            return(false);
        }