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 {

  Response response = await ioc.use<HttpService>().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;
}