enableBot method
Future<DynamiteResponse<BotEnableBotResponseApplicationJson, void> >
enableBot({
- required String token,
- required int botId,
- BotEnableBotApiVersion? apiVersion,
- bool? oCSAPIRequest,
Enables a bot.
Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.
Parameters:
apiVersion
Defaults tov1
.token
botId
ID of the bot.oCSAPIRequest
Required to be true for the API request to pass. Defaults totrue
.
Status codes:
- 200: Bot already enabled
- 201: Bot enabled successfully
- 400: Enabling bot errored
See:
- enableBotRaw for an experimental operation that returns a DynamiteRawResponse that can be serialized.
Implementation
Future<DynamiteResponse<BotEnableBotResponseApplicationJson, void>> enableBot({
required String token,
required int botId,
BotEnableBotApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final rawResponse = enableBotRaw(
token: token,
botId: botId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
);
return rawResponse.future;
}