I am developing a telegram webhook bot in java spring boot and i have been using @RestController successfully to process Update data. Теперь я заинтересован в том, я могу обработать обновление Data, просто используя Botapimethod OnWebHookupDateReceived (обновление обновления) без контроллера? If not, what is the purpose of that method at all?
I have tryed removing the @RestController and responding to updates in onWebhookUpdateReceived but ngrok logs show that responce is always 404.
Details:
- I have set webhook adress using https://api.telegram.org/botmy-token/se ... pp/webhook request
- I have been able to successfully proceed updates using:
Код: Выделить всё
@RestController
@RequestMapping("/webhook")
public class BotController {
@PostMapping
public void onUpdateReceived(@RequestBody Update update){
// more code here
}
}
- Я пробовал несколько путей для возврата значения публичной строки getbotpath () в попытках использования метода onupdeceived в классе BOT. Например: /webhook , https://my-url.ngrok-free.app/webhook и так далее, но никто не преуспевает
Подробнее здесь: https://stackoverflow.com/questions/797 ... elegramweb