edit method

Future<Message?> edit({
  1. String? content,
  2. List<EmbedBuilder>? embeds,
  3. List<RowBuilder>? components,
  4. bool? tts,
})

Implementation

Future<Message?> edit ({ String? content, List<EmbedBuilder>? embeds, List<RowBuilder>? components, bool? tts }) async {
  Http http = ioc.singleton(Service.http);

  Response response = await http.patch(
    url: '/channels/${channel.id}/messages/$id',
    payload: {
      'content': content,
      'embeds': embeds,
      'flags': flags,
      'allowed_mentions': allowMentions,
      'components': components,
    }
  );

  return response.statusCode == 200
    ? Message.from(channel: channel, payload: jsonDecode(response.body))
    : null;
}