diff --git a/Boyfriend/CommandProcessor.cs b/Boyfriend/CommandProcessor.cs index 184d6d8..c20603c 100644 --- a/Boyfriend/CommandProcessor.cs +++ b/Boyfriend/CommandProcessor.cs @@ -167,7 +167,7 @@ public sealed class CommandProcessor { return Context.Guild.GetUser(id); } - public SocketGuildUser? GetMember(string[] args, int index, string? argument) { + public SocketGuildUser? GetMember(string[] args, int index) { if (index >= args.Length) { Utils.SafeAppendToBuilder(_stackedReplyMessage, $"{ReplyEmojis.MissingArgument} {Messages.MissingMember}", Context.Message); diff --git a/Boyfriend/Commands/KickCommand.cs b/Boyfriend/Commands/KickCommand.cs index d1fd1ba..6d5689b 100644 --- a/Boyfriend/Commands/KickCommand.cs +++ b/Boyfriend/Commands/KickCommand.cs @@ -8,7 +8,7 @@ public sealed class KickCommand : ICommand { public string[] Aliases { get; } = { "kick", "кик", "выгнать" }; public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) { - var toKick = cmd.GetMember(args, 0, "ToKick"); + var toKick = cmd.GetMember(args, 0); if (toKick is null || !cmd.HasPermission(GuildPermission.KickMembers)) return; if (cmd.CanInteractWith(toKick, "Kick")) diff --git a/Boyfriend/Commands/MuteCommand.cs b/Boyfriend/Commands/MuteCommand.cs index a713420..1d2ebeb 100644 --- a/Boyfriend/Commands/MuteCommand.cs +++ b/Boyfriend/Commands/MuteCommand.cs @@ -8,7 +8,7 @@ public sealed class MuteCommand : ICommand { public string[] Aliases { get; } = { "mute", "timeout", "заглушить", "мут" }; public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) { - var toMute = cmd.GetMember(args, 0, "ToMute"); + var toMute = cmd.GetMember(args, 0); if (toMute is null) return; var duration = CommandProcessor.GetTimeSpan(args, 1); diff --git a/Boyfriend/Commands/UnmuteCommand.cs b/Boyfriend/Commands/UnmuteCommand.cs index 1468966..6310c1d 100644 --- a/Boyfriend/Commands/UnmuteCommand.cs +++ b/Boyfriend/Commands/UnmuteCommand.cs @@ -10,7 +10,7 @@ public sealed class UnmuteCommand : ICommand { public async Task RunAsync(CommandProcessor cmd, string[] args, string[] cleanArgs) { if (!cmd.HasPermission(GuildPermission.ModerateMembers)) return; - var toUnmute = cmd.GetMember(args, 0, "ToUnmute"); + var toUnmute = cmd.GetMember(args, 0); if (toUnmute is null) return; var reason = cmd.GetRemaining(args, 1, "UnmuteReason"); if (reason is not null && cmd.CanInteractWith(toUnmute, "Unmute")) diff --git a/Boyfriend/Messages.Designer.cs b/Boyfriend/Messages.Designer.cs index 430abc2..8f2be50 100644 --- a/Boyfriend/Messages.Designer.cs +++ b/Boyfriend/Messages.Designer.cs @@ -626,15 +626,6 @@ namespace Boyfriend { } } - /// - /// Looks up a localized string similar to You need to specify a setting to change!. - /// - internal static string MissingSetting { - get { - return ResourceManager.GetString("MissingSetting", resourceCulture); - } - } - /// /// Looks up a localized string similar to You need to specify a reason to unban this user!. /// @@ -698,24 +689,6 @@ namespace Boyfriend { } } - /// - /// Looks up a localized string similar to I couldn't remove role {0} because of an error! {1}. - /// - internal static string RoleRemovalFailed { - get { - return ResourceManager.GetString("RoleRemovalFailed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Someone removed the mute role manually! I added back all roles that I removed during the mute. - /// - internal static string RolesReturned { - get { - return ResourceManager.GetString("RolesReturned", resourceCulture); - } - } - /// /// Looks up a localized string similar to That setting doesn't exist!. /// diff --git a/Boyfriend/Messages.resx b/Boyfriend/Messages.resx index d8b7393..e397d73 100644 --- a/Boyfriend/Messages.resx +++ b/Boyfriend/Messages.resx @@ -207,10 +207,7 @@ Member not muted! - - Someone removed the mute role manually! I added back all roles that I removed during the mute - - + Welcome message @@ -234,10 +231,7 @@ This channel does not exist! - - I couldn't remove role {0} because of an error! {1} - - + I cannot mute someone for more than 28 days using timeouts! Either specify a duration shorter than 28 days, or set a mute role in settings @@ -381,10 +375,7 @@ You need to specify a reason for unmute this member! - - You need to specify a setting to change! - - + You cannot ban the owner of this guild! diff --git a/Boyfriend/Messages.ru.resx b/Boyfriend/Messages.ru.resx index fa00246..55b7fb2 100644 --- a/Boyfriend/Messages.ru.resx +++ b/Boyfriend/Messages.ru.resx @@ -207,10 +207,7 @@ Участник не заглушен! - - Кто-то убрал роль мута самостоятельно! Я вернул все роли, которые забрал при муте - - + Приветствие @@ -234,10 +231,7 @@ Этот канал не существует! - - Я не смог забрать роль {0} в связи с ошибкой! {1} - - + Я не могу заглушить кого-то на более чем 28 дней, используя тайм-ауты! Или укажи продолжительность менее 28 дней, или установи роль мута в настройках @@ -375,10 +369,7 @@ Надо указать причину для мута этого участника! - - Надо указать настройку, которую нужно изменить! - - + Надо указать причину для разбана этого пользователя! diff --git a/Boyfriend/Messages.tt-ru.resx b/Boyfriend/Messages.tt-ru.resx index 189f877..7da0751 100644 --- a/Boyfriend/Messages.tt-ru.resx +++ b/Boyfriend/Messages.tt-ru.resx @@ -207,10 +207,7 @@ шизоид не замучен! - - кто-то решил поумничать и обошел роль мута. я ее вернул. - - + приветствие @@ -234,10 +231,7 @@ этого канала нету, ты шо - - я не украл звание {0} в связи с ошибкой! {1} - - + ты шо, мутить больше чем на 28 дней таймаут не разрешает, вот настроишь роль мута, тогда поговорим @@ -375,10 +369,7 @@ укажи зачем мутить шизика - - укажи настройку которую менять нужно - - + укажи зачем раззабанивать шизика diff --git a/Boyfriend/Utils.cs b/Boyfriend/Utils.cs index 094a09c..1417370 100644 --- a/Boyfriend/Utils.cs +++ b/Boyfriend/Utils.cs @@ -158,13 +158,6 @@ public static partial class Utils { return true; } - public static async Task ReturnRolesAsync(SocketGuildUser user, List roles) { - // ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator - foreach (var role in roles) - if (role != user.Guild.Id) - await user.AddRoleAsync(role); - } - [GeneratedRegex("[^0-9]")] private static partial Regex NumbersOnlyRegex(); }