Added DeleteMessage, added ChannelId to outgoing messages
This commit is contained in:
@@ -591,7 +591,7 @@ namespace Discord
|
||||
if (text.Length <= 2000)
|
||||
{
|
||||
var msg = await DiscordAPI.SendMessage(channelId, text, mentions, _httpOptions);
|
||||
_messages.Update(msg.Id, msg);
|
||||
_messages.Update(msg.Id, channelId, msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -606,6 +606,17 @@ namespace Discord
|
||||
}
|
||||
}
|
||||
|
||||
public Task DeleteMessage(Message msg)
|
||||
=> DeleteMessage(msg.ChannelId, msg.Id);
|
||||
public async Task DeleteMessage(string channelId, string msgId)
|
||||
{
|
||||
try
|
||||
{
|
||||
await DiscordAPI.DeleteMessage(channelId, msgId, _httpOptions);
|
||||
}
|
||||
catch (WebException ex) when ((ex.Response as HttpWebResponse)?.StatusCode == HttpStatusCode.NotFound) { }
|
||||
}
|
||||
|
||||
//Voice
|
||||
public Task Mute(Server server, User user)
|
||||
=> Mute(server.Id, user.Id);
|
||||
|
||||
Reference in New Issue
Block a user