editMessage method
Future<DynamiteResponse<ChatEditMessageResponseApplicationJson, ChatChatEditMessageHeaders> >
editMessage({
- required String message,
- required String token,
- required int messageId,
- ChatEditMessageApiVersion? apiVersion,
- 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 totrue
.
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:
- $editMessage_Request for the request send by this method.
- $editMessage_Serializer for a converter to parse the
Response
from an executed request.
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);
}