1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-03 04:29:54 +03:00

Fix CI alerts

This commit is contained in:
Octol1ttle 2023-01-12 22:28:53 +05:00
parent 4b2d98c440
commit 587e5d11f9
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF
6 changed files with 134 additions and 133 deletions

View file

@ -49,11 +49,6 @@ public static partial class Utils {
return ulong.TryParse(NumbersOnlyRegex().Replace(mention, ""), out var id) ? id : 0;
}
public static async Task SendDirectMessage(ulong id, string toSend) {
if (await Boyfriend.Client.GetUserAsync(id) is SocketUser user)
await SendDirectMessage(user, toSend);
}
public static async Task SendDirectMessage(SocketUser user, string toSend) {
try { await user.SendMessageAsync(toSend); } catch (HttpException e) {
if (e.DiscordCode is not DiscordErrorCode.CannotSendMessageToUser) throw;