diff --git a/Commands/BannedCommands.cs b/Commands/BannedCommands.cs index 3af3bad..1ec6f20 100644 --- a/Commands/BannedCommands.cs +++ b/Commands/BannedCommands.cs @@ -186,7 +186,7 @@ public static void CheckID(ChatCommandContext ctx, string id) if (Database.VoiceBans?.Find(x => x.PlayerID == ID) is Ban voiceBan) allBans.Add(voiceBan); - if(allBans.Count == 0) + if (allBans.Count == 0) { ctx.Reply($"No bans found for ID {ID}."); return; @@ -213,6 +213,12 @@ var b when Database.VoiceBans.Contains(b) => Database.VoiceBans, } } + if (playerBans.Count == 0) + { + ctx.Reply($"No bans found for ID {ID}."); + return; + } + StringBuilder banList = new StringBuilder(); banList.AppendLine(Database.Messages[0].ToString(playerBans[0].Item1, playerBans[0].Item2)); if (Extensions.TryGetPlayerInfo(ID, out PlayerInfo playerInfo) && ContainsNonLocal) @@ -283,7 +289,7 @@ var b when Database.VoiceBans.Contains(b) => Database.VoiceBans, internal static bool GetBanDetails(Ban ban, List list, out BanDetails details) { - if (DateTime.Now > ban.TimeUntil.ToLocalTime()) + if (!TimeUtility.IsPermanent(ban.TimeUntil) && DateTime.Now > ban.TimeUntil.ToLocalTime()) { details = null; Database.DeleteBan(ban, list);