diff --git a/NadekoBot/Modules/Administration/AdministrationModule.cs b/NadekoBot/Modules/Administration/AdministrationModule.cs index 2caeb759..f1ddd827 100644 --- a/NadekoBot/Modules/Administration/AdministrationModule.cs +++ b/NadekoBot/Modules/Administration/AdministrationModule.cs @@ -986,7 +986,7 @@ namespace NadekoBot.Modules.Administration if (string.IsNullOrWhiteSpace(game)) return; var en = e.Server.Users - .Where(u => u.CurrentGame?.ToUpperInvariant() == game) + .Where(u => u.CurrentGame?.Name.ToUpperInvariant() == game) .Select(u => $"{u.Name}"); var arr = en as string[] ?? en.ToArray(); diff --git a/NadekoBot/Modules/Administration/Commands/InfoCommands.cs b/NadekoBot/Modules/Administration/Commands/InfoCommands.cs index 3f3e18e6..94c1bf51 100644 --- a/NadekoBot/Modules/Administration/Commands/InfoCommands.cs +++ b/NadekoBot/Modules/Administration/Commands/InfoCommands.cs @@ -86,7 +86,7 @@ namespace NadekoBot.Modules.Administration.Commands if (!string.IsNullOrWhiteSpace(user.Nickname)) sb.AppendLine($"`Nickname:` **{user.Nickname}**"); sb.AppendLine($"`Id:` **{user.Id}**"); - sb.AppendLine($"`Current Game:` **{(string.IsNullOrWhiteSpace(user.CurrentGame) ? "-" : user.CurrentGame)}**"); + sb.AppendLine($"`Current Game:` **{(user.CurrentGame == null ? "-" : user.CurrentGame.Value.Name)}**"); if (user.LastOnlineAt != null) sb.AppendLine($"`Last Online:` **{user.LastOnlineAt:HH:mm:ss}**"); sb.AppendLine($"`Joined At:` **{user.JoinedAt}**"); diff --git a/NadekoBot/Modules/Administration/Commands/VoicePlusTextCommand.cs b/NadekoBot/Modules/Administration/Commands/VoicePlusTextCommand.cs index 9d5d8543..f62b9ba6 100644 --- a/NadekoBot/Modules/Administration/Commands/VoicePlusTextCommand.cs +++ b/NadekoBot/Modules/Administration/Commands/VoicePlusTextCommand.cs @@ -85,6 +85,22 @@ namespace NadekoBot.Modules.Administration.Commands internal override void Init(CommandGroupBuilder cgb) { + cgb.CreateCommand(Module.Prefix + "cleanv+t") + .Description("Deletes all text channels ending in `-voice` for which voicechannels are not found. **Use at your own risk.**") + .AddCheck(SimpleCheckers.CanManageRoles) + .AddCheck(SimpleCheckers.ManageChannels()) + .Do(async e => + { + var allTxtChannels = e.Server.TextChannels.Where(c => c.Name.EndsWith("-voice")); + var validTxtChannelNames = e.Server.VoiceChannels.Select(c => GetChannelName(c.Name)); + + var invalidTxtChannels = allTxtChannels.Where(c => !validTxtChannelNames.Contains(c.Name)); + + invalidTxtChannels.ForEach(async c => await c.Delete()); + + await e.Channel.SendMessage("`Done.`"); + }); + cgb.CreateCommand(Module.Prefix + "v+t") .Alias(Module.Prefix + "voice+text") .Description("Creates a text channel for each voice channel only users in that voice channel can see." + diff --git a/discord.net b/discord.net index 64d4b0af..80f9d6f2 160000 --- a/discord.net +++ b/discord.net @@ -1 +1 @@ -Subproject commit 64d4b0af324f12d2130b4d16b1900c2a6457adf4 +Subproject commit 80f9d6f2de25355a245bf93d4019d16e3fd033ca