BotController Class

  • java.lang.Object
    • com.microsoft.bot.integration.spring.BotController

public class BotController

This is the default controller that will receive incoming Channel Activity messages.

This controller is suitable in most cases. Bots that want to use this controller should do so by using the @Import(\{BotController.class\}) annotation. See any of the samples Application class for an example.

Constructor Summary

Constructor Description
BotController(BotFrameworkHttpAdapter withAdapter, Bot withBot)

Spring will use this constructor for creation.

Method Summary

Modifier and Type Method and Description
java.util.concurrent.CompletableFuture<org.springframework.http.ResponseEntity<java.lang.Object>> incoming(Activity activity, String authHeader)

This will receive incoming Channel Activities.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

BotController

public BotController(BotFrameworkHttpAdapter withAdapter, Bot withBot)

Spring will use this constructor for creation.

The Bot application should define class that implements Bot and annotate it with @Component.

Parameters:

withAdapter - The BotFrameworkHttpAdapter to use.
withBot - The Bot to use.

Method Details

incoming

public CompletableFuture> incoming(Activity activity, String authHeader)

This will receive incoming Channel Activities.

Parameters:

activity - The incoming Activity.
authHeader - The incoming Authorization header.

Returns:

The request response.

Applies to