I need help with this error when working with Telegram API
Error removing old webhook
at org.telegram.telegrambots.util.WebhookUtils.clearWebhook(WebhookUtils.java:112)
.....
Caused by: Error deleting webhook: [404] Not Found
I have created a bot with telegram,
Service class:
@Service
public class Test1Api {
@Autowired
public Test1Api(@Value("${bot.username:}") String botUserName, @Value("${bot.token:}") String botToken) {
try {
TelegramBotsApi telegramBotsApi = new TelegramBotsApi(DefaultBotSession.class);
telegramBotsApi.registerBot(new Test1Bot(botUserName, botToken));
} catch (TelegramApiException e) {
e.printStackTrace();
}
}
}
here is the bot class
public class Test1Bot extends TelegramLongPollingBot {
private final String botUserName;
private final String botToken;
public Test1Bot(String botUserName, String botToken) {
this.botUserName = botUserName;
this.botToken = botToken;
}
@Override
public String getBotUsername() {
return botUserName;
}
@Override
public String getBotToken() {
return botToken;
}
@Override
public void onUpdateReceived(Update update) {
System.out.println(update.getMessage().getText());
System.out.println(update.getMessage().getFrom());
}
When i try to run my code i have an error from telegram attaching here The error from telegram: What can i do to fix it?