editMessage method

Future<DynamiteResponse<ChatEditMessageResponseApplicationJson, ChatChatEditMessageHeaders>> editMessage({
  1. required String message,
  2. required String token,
  3. required int messageId,
  4. ChatEditMessageApiVersion? apiVersion,
  5. bool? oCSAPIRequest,
})

Edit 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:

  • message the message to send.
  • 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 edited successfully
  • 202: Message edited successfully, but a bot or Matterbridge is configured, so the information can be replicated to other services
  • 400: Editing message is not possible, e.g. when the new message is empty or the message is too old
  • 403: Missing permissions to edit message
  • 404: Message not found
  • 405: Editing this message type is not allowed
  • 413: Message too long

See:

Implementation

Future<_i1.DynamiteResponse<ChatEditMessageResponseApplicationJson, ChatChatEditMessageHeaders>> editMessage({
  required String message,
  required String token,
  required int messageId,
  ChatEditMessageApiVersion? apiVersion,
  bool? oCSAPIRequest,
}) async {
  final _request = $editMessage_Request(
    message: message,
    token: token,
    messageId: messageId,
    apiVersion: apiVersion,
    oCSAPIRequest: oCSAPIRequest,
  );
  final _response = await _rootClient.httpClient.send(_request);

  final _serializer = $editMessage_Serializer();
  final _rawResponse =
      await _i1.ResponseConverter<ChatEditMessageResponseApplicationJson, ChatChatEditMessageHeaders>(_serializer)
          .convert(_response);
  return _i1.DynamiteResponse.fromRawResponse(_rawResponse);
}