updateChannelMessages function

Future updateChannelMessages(
  1. String messageId,
  2. String body
)

updateChannelMessages is to PATCH a single message

Implementation

Future updateChannelMessages(String messageId, String body) async {
  Uri url = Uri.parse(
      "https://discord.com/api/v10/channels/${DiscordLogger.instance.channelId}/messages/$messageId");
  final response = await http.patch(
    url,
    headers: {
      "Accept": "application/json",
      "Content-Type": "application/json",
      "Authorization": "Bot ${DiscordLogger.instance.botToken}",
    },
    body: body,
  );

  if (response.statusCode == 200) {
    return true;
  } else {
    return false;
  }
}