deleteChannelMessages function
deleteChannelMessages is to DELETE
a message
Implementation
Future deleteChannelMessages(String messageId) async {
Uri url = Uri.parse(
"https://discord.com/api/v10/channels/${DiscordLogger.instance.channelId}/messages/$messageId");
final response = await http.delete(
url,
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bot ${DiscordLogger.instance.botToken}",
},
);
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}