CommandBot class
Warning
This API is now deprecated.
This package will be deprecated by 2026-07. Please use Microsoft 365 Agents SDK instead.
A command bot for receiving commands and sending responses in Teams.
Remarks
Ensure each command should ONLY be registered with the command once, otherwise it'll cause unexpected behavior if you register the same command more than once.
Constructors
| Command |
Create a new instance of the |
Methods
| register |
Register a command into the command bot. |
| register |
Register commands into the command bot. |
| register |
Register a sso command into the command bot. |
| register |
Register sso commands into the command bot. |
Constructor Details
CommandBot(CloudAdapter, CommandOptions, BotSsoExecutionActivityHandler, BotSsoConfig)
Warning
This API is now deprecated.
This package will be deprecated by 2026-07. Please use Microsoft 365 Agents SDK instead.
Create a new instance of the CommandBot.
new CommandBot(adapter: CloudAdapter, options?: CommandOptions, ssoCommandActivityHandler?: BotSsoExecutionActivityHandler, ssoConfig?: BotSsoConfig)
Parameters
- adapter
- CloudAdapter
The bound CloudAdapter.
- options
- CommandOptions
The initialize options
- ssoCommandActivityHandler
- BotSsoExecutionActivityHandler
SSO execution activity handler.
- ssoConfig
- BotSsoConfig
SSO configuration for Bot SSO.
Method Details
registerCommand(TeamsFxBotCommandHandler)
Warning
This API is now deprecated.
This package will be deprecated by 2026-07. Please use Microsoft 365 Agents SDK instead.
Register a command into the command bot.
function registerCommand(command: TeamsFxBotCommandHandler)
Parameters
- command
- TeamsFxBotCommandHandler
The command to be registered.
registerCommands(TeamsFxBotCommandHandler[])
Warning
This API is now deprecated.
This package will be deprecated by 2026-07. Please use Microsoft 365 Agents SDK instead.
Register commands into the command bot.
function registerCommands(commands: TeamsFxBotCommandHandler[])
Parameters
- commands
The commands to be registered.
registerSsoCommand(TeamsFxBotSsoCommandHandler)
Warning
This API is now deprecated.
This package will be deprecated by 2026-07. Please use Microsoft 365 Agents SDK instead.
Register a sso command into the command bot.
function registerSsoCommand(ssoCommand: TeamsFxBotSsoCommandHandler)
Parameters
- ssoCommand
- TeamsFxBotSsoCommandHandler
The sso command to be registered.
registerSsoCommands(TeamsFxBotSsoCommandHandler[])
Warning
This API is now deprecated.
This package will be deprecated by 2026-07. Please use Microsoft 365 Agents SDK instead.
Register sso commands into the command bot.
function registerSsoCommands(ssoCommands: TeamsFxBotSsoCommandHandler[])
Parameters
- ssoCommands
The sso commands to be registered.