diff --git a/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs b/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs index cf1facb..2a65ae4 100644 --- a/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs +++ b/loginspect/LogInspect/LogInspect/Modules/LogCommandModule.cs @@ -10,15 +10,12 @@ namespace LogInspect.Modules; [CommandContextType(InteractionContextType.BotDm, InteractionContextType.PrivateChannel, InteractionContextType.Guild)] [IntegrationType(ApplicationIntegrationType.UserInstall)] +// ReSharper disable once UnusedType.Global public partial class LogCommandModule : InteractionModuleBase<SocketInteractionContext> { private static readonly Dictionary<ulong, Paginator> PageMap = new(); private static readonly McLogInspector McLogInspector = new(); - - public LogCommandModule() - { - } - + [SlashCommand("mclog", "Inspect a Minecraft log file")] public async Task LatestAsync(string link, bool ephemeral = true) { @@ -139,12 +136,7 @@ private string GeneratePageOne(string[] lines, int stacktraceAmount) { minecraftVersion = versionLines[0].Split("]").Last().Split(": ").Last(); - var timeCreatedMatch = LatestLogTimeCreatedRegex().Match(lines[0]); - - if (timeCreatedMatch.Success) - { - timeCreated = timeCreatedMatch.Value; - } + timeCreated = lines[0].Split("]").First().Replace("[", "").Trim(); } else { @@ -213,7 +205,4 @@ private string GeneratePageOne(string[] lines, int stacktraceAmount) return string.Join("\n", newLines); } - - [GeneratedRegex(@"\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}")] - private static partial Regex LatestLogTimeCreatedRegex(); } \ No newline at end of file