Example #1
1
 /**
  * start conversation
  * @return [type] [description]
  */
 public static function start()
 {
     $result = [['text' => "به *_fullName_* خوش آمدید." . " /help", 'reply_markup' => menu::main(true)]];
     // on debug mode send made by ermile at the end of start msg
     if (\lib\utility\option::get('telegram', 'meta', 'debug')) {
         $result[] = ['text' => "Made by @Ermile"];
     }
     return $result;
 }
Example #2
0
 /**
  * finisht register process
  * @param  [type] $_status [description]
  * @return [type]          [description]
  */
 private static function finish($_status)
 {
     $result = ['text' => "", 'reply_markup' => menu::main(true)];
     switch ($_status) {
         case 'limit':
             $txt = T_('Dear friend') . "\n";
             $txt .= T_('We need your phone number to verifying your account.') . "\n";
             $txt .= T_('If you dont want share your number, we cant presenting our services to you!') . "\n";
             $result['text'] = $txt;
             step::stop();
             break;
         case 'successful':
             $txt = T_('Registering user is successful.') . "\n";
             $result['text'] = $txt;
             $result['reply_markup'] = null;
             bot::sendResponse($result);
         case 'registered':
             // check if want to come back to specefic step, do it
             $result = self::successful();
             break;
         case 'failed':
             $result = false;
         case 'return':
             $txt = T_('Cancel registration and return to main menu') . "\n";
             $result['text'] = $txt;
             step::stop();
             break;
         case 'wrong':
         default:
             // else send messge to attention to user to only send contact detail
             $txt = T_('Please only use below keyboard.');
             $txt = T_('We need your contact!') . "\n";
             $menu = menu_profile::getContact(true);
             $result['text'] = $txt;
             $result['reply_markup'] = $menu;
             break;
     }
     // return menu
     return $result;
 }