rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.68k stars 1.18k forks source link

webhook #178

Closed massimiliano76 closed 7 years ago

massimiliano76 commented 7 years ago

Hi,

I trued to create my own bot using you example as template, when I make the project I receive this error:

--- exec-maven-plugin:1.2.1:exec (default-cli) @ botapi --- Dec 18, 2016 1:12:57 PM org.telegram.telegrambots.logging.BotLogger severe SEVERE: MAIN org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error removing old webhook: [404] Not Found at org.telegram.telegrambots.bots.TelegramLongPollingBot.clearWebhook(TelegramLongPollingBot.java:50) at org.telegram.telegrambots.TelegramBotsApi.registerBot(TelegramBotsApi.java:82) at org.telegram.Main.main(Main.java:45)

Dec 18, 2016 1:12:57 PM org.telegram.telegrambots.logging.BotLogger severe SEVERE: MAIN org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error removing old webhook: [404] Not Found at org.telegram.telegrambots.bots.TelegramLongPollingBot.clearWebhook(TelegramLongPollingBot.java:50) at org.telegram.telegrambots.TelegramBotsApi.registerBot(TelegramBotsApi.java:82) at org.telegram.Main.main(Main.java:45)

How can I do? Thank you very much. P.s. I'm using Netbeans 8.2 Maven Project

gillesbraun commented 7 years ago

Check if in your TelegramLongPollingCommandBot implementation the methods getBotUsername and getBotToken are configured correctly.

rubenlagus commented 7 years ago

Since there is no answer, I assume it is solved.

Rebelllious commented 6 years ago

I have run into the same error when I copied the example from your repository and added my own bot name and API key. Bot name and API key are indicated properly. How can this be fixed?

nicholas-nimak commented 6 years ago

I got same bug when wrote username instead of token and vice versa.

carmuno commented 1 year ago

you must specify the token and user in the same class bot