edit method
Future<DmMessage?>
edit({
- String? content,
- List<
EmbedBuilder> ? embeds, - ComponentBuilder? components,
- List<
AttachmentBuilder> ? attachments, - bool? tts,
Implementation
Future<DmMessage?> edit ({ String? content, List<EmbedBuilder>? embeds, ComponentBuilder? components, List<AttachmentBuilder>? attachments, bool? tts }) async {
dynamic messagePayload = MessageParser(content, embeds, components, attachments, null).toJson();
Response response = await ioc.use<DiscordApiHttpService>().patch(url: '/channels/${channel.id}/messages/$id')
.files(messagePayload['files'])
.payload({
...messagePayload['payload'],
'flags': flags,
'allowed_mentions': allowMentions
})
.build();
return response.statusCode == 200
? DmMessage.from(channel: channel, payload: jsonDecode(response.body))
: null;
}