TeamsBotApplicationOptions.UseSocketMode Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| UseSocketMode(Action<SocketModeOptions>) |
Enables Socket Mode and configures its SocketModeOptions for the negotiate URL and geos. Socket Mode receives activities over outbound WebSocket connections instead of an inbound HTTP endpoint. |
| UseSocketMode(Boolean) |
Enables or disables Socket Mode with the default SocketModeOptions. Socket Mode receives activities over outbound WebSocket connections instead of an inbound HTTP endpoint. |
UseSocketMode(Action<SocketModeOptions>)
Enables Socket Mode and configures its SocketModeOptions for the negotiate URL and geos. Socket Mode receives activities over outbound WebSocket connections instead of an inbound HTTP endpoint.
public Microsoft.Teams.Apps.TeamsBotApplicationOptions UseSocketMode(Action<Microsoft.Teams.Apps.SocketMode.SocketModeOptions> configure);
member this.UseSocketMode : Action<Microsoft.Teams.Apps.SocketMode.SocketModeOptions> -> Microsoft.Teams.Apps.TeamsBotApplicationOptions
Public Function UseSocketMode (configure As Action(Of SocketModeOptions)) As TeamsBotApplicationOptions
Parameters
- configure
- Action<SocketModeOptions>
Delegate to configure SocketModeOptions.
Returns
This instance for chaining.
Remarks
The host does not finish starting until every configured geo is connected, and a startup failure stops the host. Supported only in the public cloud. Build the bot with Host.CreateApplicationBuilder() (no web server) and get the app with host.UseTeamsBotApplication(). Socket Mode is experimental: the API is in preview and may change, and it is recommended only for developing agents. Socket Mode is currently only available for new bots.
Applies to
UseSocketMode(Boolean)
Enables or disables Socket Mode with the default SocketModeOptions. Socket Mode receives activities over outbound WebSocket connections instead of an inbound HTTP endpoint.
public Microsoft.Teams.Apps.TeamsBotApplicationOptions UseSocketMode(bool enabled = true);
member this.UseSocketMode : bool -> Microsoft.Teams.Apps.TeamsBotApplicationOptions
Public Function UseSocketMode (Optional enabled As Boolean = true) As TeamsBotApplicationOptions
Parameters
- enabled
- Boolean
Whether to receive activities over Socket Mode. Default is true.
Returns
This instance for chaining.
Remarks
The host does not finish starting until every configured geo is connected, and a startup failure stops the host. Supported only in the public cloud. Build the bot with Host.CreateApplicationBuilder() (no web server) and get the app with host.UseTeamsBotApplication(). Passing false clears any earlier Socket Mode configuration, so the bot receives activities over HTTP. Socket Mode is experimental: the API is in preview and may change, and it is recommended only for developing agents. Socket Mode is currently only available for new bots.