editMessage method
Future<DynamiteResponse<ChatEditMessageResponseApplicationJson, ChatChatEditMessageHeaders> >
editMessage({
- required String token,
- required int messageId,
- required ChatEditMessageRequestApplicationJson $body,
- 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:
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 token,
required int messageId,
required ChatEditMessageRequestApplicationJson $body,
ChatEditMessageApiVersion? apiVersion,
bool? oCSAPIRequest,
}) async {
final _request = $editMessage_Request(
token: token,
messageId: messageId,
apiVersion: apiVersion,
oCSAPIRequest: oCSAPIRequest,
$body: $body,
);
final _streamedResponse = await _rootClient.httpClient.send(_request);
final _response = await _i3.Response.fromStream(_streamedResponse);
final _serializer = $editMessage_Serializer();
return _i1.ResponseConverter<ChatEditMessageResponseApplicationJson, ChatChatEditMessageHeaders>(_serializer)
.convert(_response);
}