W
W
Werner Heisenberg2021-04-29 23:50:32
Java
Werner Heisenberg, 2021-04-29 23:50:32

How to run telegram bot in java?

I'm trying to run a telegram bot which is written in java and which uses the markup language for chatbots AIML. When I enter the bot's token and name, and then try to compile, I get the same error all the time...
The bot's repository itself is third-party - https://github.com/baalajimaestro/Java-AIML-Bot . I just added a couple of AIML scripted dialogs. It is likely that the author explained a possible workaround for this error, it just didn’t reach me.

org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error removing old webhook
  at org.telegram.telegrambots.bots.TelegramLongPollingBot.clearWebhook(TelegramLongPollingBot.java:32)
  at org.telegram.telegrambots.TelegramBotsApi.registerBot(TelegramBotsApi.java:120)
  at Chatbot.main(Chatbot.java:111)
Caused by: org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error deleting webhook: [401] Unauthorized
  at org.telegram.telegrambots.api.methods.updates.DeleteWebhook.deserializeResponse(DeleteWebhook.java:40)
  at org.telegram.telegrambots.api.methods.updates.DeleteWebhook.deserializeResponse(DeleteWebhook.java:19)
  at org.telegram.telegrambots.bots.DefaultAbsSender.sendApiMethod(DefaultAbsSender.java:689)
  at org.telegram.telegrambots.bots.AbsSender.execute(AbsSender.java:53)
  at org.telegram.telegrambots.bots.TelegramLongPollingBot.clearWebhook(TelegramLongPollingBot.java:27)
  ... 2 more

608b1c06f0a2c151030903.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-04-29
@arkjjj

TelegramApiRequestException: Error deleting webhook: [401] Unauthorized

Here, similar problem:
https://stackoverflow.com/questions/48641520/teleg...
Check the token. For some reason, authorization does not occur. Check your credentials

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question