Esempio n. 1
0
 /**
  * handle user input
  * @return [type] [description]
  */
 public static function step2()
 {
     // // do not need to save text of contact if called!
     // step::set('saveText', false);
     // increase limit valu
     step::plus(1, 'limit');
     // if user more than 3 times do not send contact go to main menu
     if (step::get('limit') > 3) {
         // call stop function
         return self::finish('limit');
     }
     $cmd = bot::$cmd;
     // if user send his/her profile contact detail
     switch ($cmd['command']) {
         case 'type_contact':
             // show successful for define question
             $result = self::finish('successful');
             break;
         case T_('return'):
         case 'return':
         case '/return':
             $result = self::finish('return');
             break;
         default:
             $result = self::finish('wrong');
             break;
     }
     return $result;
 }
Esempio n. 2
0
 /**
  * show thanks message
  * @return [type] [description]
  */
 public static function step1()
 {
     // after this go to next step
     step::plus();
     // show give contact menu
     $menu = self::$menu;
     $txt_text = "";
     if (bot::$user_id) {
         $txt_text = "با تشکر از شما بابت اعتمادتان.\n\n";
     }
     $txt_text .= "تمام تلاش ما بر افزایش کیفیت _name_ است. ";
     $txt_text .= "بدین منظور دانستن نظرات ارزشمند شما درباره مشکلات و نواقص و صد البته پیشنهادات گرانبهای شما سبب کمک به ما برای این مهم خواهد شد.\n";
     $txt_text .= "لطفا نظر خود را درباره‌ی _name_ برای ما بنویسید.\n";
     $result = [['text' => $txt_text, 'reply_markup' => $menu]];
     // return menu
     return $result;
 }