2017-10-24 3 views
0

私はSpringフレームワークでJAVA Telegram Bot APIを使用しています。私はHomeControllerでメソッドを持っていました。ユーザーから。私は私の春のログでこれらのエラーを得た、私は電信ボットのAPIから重複した応答を得た.whatsは問題ですか? JAVA電報のボットapi更新を取得中にエラーが発生しました:競合:他の長いポーリングやwebhookで終了しました

@PostConstruct 
    public void initBots() { 
     ApiContextInitializer.init(); 
     TelegramBotsApi botsApi = new TelegramBotsApi(); 
     BotService botService = new BotService(); 
     try { 
      botsApi.registerBot(botService); 
     } catch (TelegramApiException e) { 
      e.printStackTrace(); 
     } 
    } 

org.telegram.telegrambots.logging.BotLogger.severe BOTSESSION org.telegram.telegrambots.exceptions.TelegramApiRequestException [電報接続abrsystem1_bot]: 取得時にエラーが発生しましアップデート:[409]競合:によって終了 org.telegram.telegrambots.api.methods.updates.GetUpdates.deserializeResponse(GetUpdates.java:119) でorg.telegram.telegrambots.updatesreceivers.DefaultBotSession $ ReaderThread.getUpdatesFromServer(DefaultBotSession.javaで他の長いポーリング またはウェブフック:255) 私は上のIntelliJアイデアを自分のプロジェクトをデバッグたとき org.telegram.telegrambots.updatesreceivers.DefaultBotSession $ ReaderThread.run(DefaultBotSession.java:186)

@Override 
public void onUpdateReceived(Update update) { 
    try { 

     if (update.hasMessage() && update.getMessage().hasText()) { 

      String message_text = update.getMessage().getText(); 
      String wellcome_text = "برای ثبت نام در سایت شماره تلفن همراه خود را به اشتراک بگذارید"; 

      long chat_id = update.getMessage().getChatId(); 
      if (message_text.equals("/start")) { 

       try { 
        SendMessage message = new SendMessage() 
          .setChatId(chat_id) 
          .setText(wellcome_text); 

        ReplyKeyboardMarkup keyboardMarkup = new ReplyKeyboardMarkup(); 
        List<KeyboardRow> keyboard = new ArrayList<KeyboardRow>(); 
        KeyboardRow row = new KeyboardRow(); 
        row.add((new KeyboardButton().setText("اشتراک شماره موبایل").setRequestContact(true))); 
        keyboard.add(row); 
        keyboardMarkup.setKeyboard(keyboard); 
        message.setReplyMarkup(keyboardMarkup); 

        try { 
         execute(message); 
        } catch (TelegramApiException e) { 
         e.printStackTrace(); 
        } 
       } catch (Exception e) { 
        e.printStackTrace(); 
       } 

      } else if (message_text.equals("تایید مشخصات کاربری")) { 
       SendMessage sendMessage = new SendMessage(); 
       sendMessage.setChatId(chat_id).setText("اطلاعات مورد تایید قرار گرفت"); 

       try { 
        execute(sendMessage); 
        removeMarker(chat_id); 
        showContactInfo(chat_id, update); 
       } catch (Exception ex) { 
        ex.printStackTrace(); 
       } 
      } else if (message_text.equals("تغییر مشخصات")) { 

      } else { 
       showUnknownCommand(chat_id); 
      } 
     } else if (update.getMessage().getContact() != null && update.getMessage().getChat() != null) { 

      long chat_id = update.getMessage().getChatId(); 
      showContactInfo(chat_id, update); 
     } 
    } catch (Exception e) { 
     e.printStackTrace(); 
    } 
} 

答えて

0

で私は最終的に!一日の後に私の問題を解決しました私のコンピュータ、私はデバッグのために多くのインスタンスを作成したので、私は電報bot.so退屈な問題で同じチャットIDから複数の応答を得ました....

関連する問題