mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
Fix CI alerts
This commit is contained in:
parent
4b2d98c440
commit
587e5d11f9
6 changed files with 134 additions and 133 deletions
|
@ -135,7 +135,7 @@ public sealed class CommandProcessor {
|
|||
return null;
|
||||
}
|
||||
|
||||
return Tuple.Create(mention, (SocketUser?)Boyfriend.Client.GetUser(mention));
|
||||
return Tuple.Create(mention, Boyfriend.Client.GetUser(mention))!;
|
||||
}
|
||||
|
||||
public bool HasPermission(GuildPermission permission) {
|
||||
|
|
2
Boyfriend/Messages.Designer.cs
generated
2
Boyfriend/Messages.Designer.cs
generated
|
@ -1050,7 +1050,7 @@ namespace Boyfriend {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to .
|
||||
/// Looks up a localized string similar to I could not find this user in any guild I'm a member of! Check if the ID is correct and that the user was on this server no longer than 30 days ago (TODO).
|
||||
/// </summary>
|
||||
internal static string UserNotFound {
|
||||
get {
|
||||
|
|
|
@ -457,6 +457,6 @@
|
|||
<value>Early event start notification offset</value>
|
||||
</data>
|
||||
<data name="UserNotFound" xml:space="preserve">
|
||||
<value/>
|
||||
<value>I could not find this user in any guild I'm a member of! Check if the ID is correct and that the user was on this server no longer than 30 days ago (TODO)</value>
|
||||
</data>
|
||||
</root>
|
||||
|
|
|
@ -456,4 +456,7 @@
|
|||
<data name="SettingsEventEarlyNotificationOffset" xml:space="preserve">
|
||||
<value>Офсет отправки преждевременного уведомления о начале события</value>
|
||||
</data>
|
||||
<data name="UserNotFound" xml:space="preserve">
|
||||
<value>Я не смог найти этого пользователя ни в одном из серверов, в которых я есть. Проверь правильность ID и нахождение пользователя на этом сервере максимум 30 дней назад (TODO)</value>
|
||||
</data>
|
||||
</root>
|
|
@ -456,4 +456,7 @@
|
|||
<data name="SettingsEventEarlyNotificationOffset" xml:space="preserve">
|
||||
<value>заранее пнуть в минутах до начала квеста</value>
|
||||
</data>
|
||||
<data name="UserNotFound" xml:space="preserve">
|
||||
<value>TODO</value>
|
||||
</data>
|
||||
</root>
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue