From 587e5d11f9f9f59fb958b7b68c44323b2e8c36f0 Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Thu, 12 Jan 2023 22:28:53 +0500 Subject: [PATCH] Fix CI alerts --- Boyfriend/CommandProcessor.cs | 2 +- Boyfriend/Messages.Designer.cs | 2 +- Boyfriend/Messages.resx | 4 +- Boyfriend/Messages.ru.resx | 127 +++++++++++++++++---------------- Boyfriend/Messages.tt-ru.resx | 127 +++++++++++++++++---------------- Boyfriend/Utils.cs | 5 -- 6 files changed, 134 insertions(+), 133 deletions(-) diff --git a/Boyfriend/CommandProcessor.cs b/Boyfriend/CommandProcessor.cs index 00675f8..62677c2 100644 --- a/Boyfriend/CommandProcessor.cs +++ b/Boyfriend/CommandProcessor.cs @@ -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) { diff --git a/Boyfriend/Messages.Designer.cs b/Boyfriend/Messages.Designer.cs index d05442c..197898a 100644 --- a/Boyfriend/Messages.Designer.cs +++ b/Boyfriend/Messages.Designer.cs @@ -1050,7 +1050,7 @@ namespace Boyfriend { } /// - /// 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). /// internal static string UserNotFound { get { diff --git a/Boyfriend/Messages.resx b/Boyfriend/Messages.resx index 93cb1ea..e892deb 100644 --- a/Boyfriend/Messages.resx +++ b/Boyfriend/Messages.resx @@ -457,6 +457,6 @@ Early event start notification offset - - + 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) + diff --git a/Boyfriend/Messages.ru.resx b/Boyfriend/Messages.ru.resx index 1e18a25..d18eaf5 100644 --- a/Boyfriend/Messages.ru.resx +++ b/Boyfriend/Messages.ru.resx @@ -1,64 +1,64 @@  - + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, ... + System.Resources.ResXResourceWriter, System.Windows.Forms, ... + this is my long stringthis is a comment + Blue + + [base64 mime encoded serialized .NET Framework object] + + + [base64 mime encoded string representing a byte array form of the .NET Framework object] + This is a comment + + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> @@ -447,13 +447,16 @@ Ты не можешь вернуть из мута этого пользователя! - + Я не могу вернуть из мута этого пользователя! - + {0}Событие {1} начнется <t:{2}:R>! - + Офсет отправки преждевременного уведомления о начале события - \ No newline at end of file + + Я не смог найти этого пользователя ни в одном из серверов, в которых я есть. Проверь правильность ID и нахождение пользователя на этом сервере максимум 30 дней назад (TODO) + + diff --git a/Boyfriend/Messages.tt-ru.resx b/Boyfriend/Messages.tt-ru.resx index 9ac5be9..046089b 100644 --- a/Boyfriend/Messages.tt-ru.resx +++ b/Boyfriend/Messages.tt-ru.resx @@ -1,64 +1,64 @@ - + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms, ... + System.Resources.ResXResourceWriter, System.Windows.Forms, ... + this is my long stringthis is a comment + Blue + + [base64 mime encoded serialized .NET Framework object] + + + [base64 mime encoded string representing a byte array form of the .NET Framework object] + This is a comment + + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> @@ -447,13 +447,16 @@ тебе нельзя раззамучивать - + я не могу его раззамутить... - + {0}квест {1} начнется <t:{2}:R>! - + заранее пнуть в минутах до начала квеста - \ No newline at end of file + + TODO + + diff --git a/Boyfriend/Utils.cs b/Boyfriend/Utils.cs index 8aa7096..39705b1 100644 --- a/Boyfriend/Utils.cs +++ b/Boyfriend/Utils.cs @@ -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;