Class TelegramController


  • @Requires(beans={TokenValidator.class,Dispatcher.class,TelegramBotConfiguration.class}) @Requires(property="micronaut.chatbots.telegram.endpoint.enabled",notEquals="false",defaultValue="true")
    @Controller("${micronaut.chatbots.telegram.endpoint.path:/telegram}")
    public class TelegramController
    extends java.lang.Object
    Defines a route to handle the Telegram Chatbot webhook.
    Since:
    1.0.0
    Author:
    Sergio del Amo
    • Method Detail

      • callback

        @Post
        public io.micronaut.http.HttpResponse<Send> callback​(@Header("X-Telegram-Bot-Api-Secret-Token")
                                                             java.lang.String apiSecretToken,
                                                             @Body
                                                             Update update)
        Parameters:
        apiSecretToken - A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request.
        update - Telegram Message
        Returns:
        HTTP Response. It could 200 OK with an empty body if the request is handle asynchronously or a 200 with the response payload if the request is handled synchronously.
        See Also:
        setWebhook