deleteMessage method

Future<DynamiteResponse<ChatDeleteMessageResponseApplicationJson, ChatChatDeleteMessageHeaders>> deleteMessage({
  1. required String token,
  2. required int messageId,
  3. ChatDeleteMessageApiVersion? apiVersion,
  4. bool? oCSAPIRequest,
})

Delete a chat message.

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 to "v1".
  • token
  • messageId ID of the message.
  • oCSAPIRequest Required to be true for the API request to pass. Defaults to true.

Status codes:

  • 200: Message deleted successfully
  • 202: Message deleted successfully, but a bot or Matterbridge is configured, so the information can be replicated elsewhere
  • 400: Deleting message is not possible
  • 403: Missing permissions to delete message
  • 404: Message not found
  • 405: Deleting this message type is not allowed

See:

Implementation

Future<_i1.DynamiteResponse<ChatDeleteMessageResponseApplicationJson, ChatChatDeleteMessageHeaders>> deleteMessage({
  required String token,
  required int messageId,
  ChatDeleteMessageApiVersion? apiVersion,
  bool? oCSAPIRequest,
}) async {
  final _request = $deleteMessage_Request(
    token: token,
    messageId: messageId,
    apiVersion: apiVersion,
    oCSAPIRequest: oCSAPIRequest,
  );
  final _response = await _rootClient.httpClient.send(_request);

  final _serializer = $deleteMessage_Serializer();
  final _rawResponse =
      await _i1.ResponseConverter<ChatDeleteMessageResponseApplicationJson, ChatChatDeleteMessageHeaders>(_serializer)
          .convert(_response);
  return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}