Tyrrrz / DiscordChatExporter

Exports Discord chat logs to a file
MIT License
7.48k stars 682 forks source link

Strange error when trying to back up group chat - Task name cannot be empty (Parameter 'description') #1133

Closed ghost closed 11 months ago

ghost commented 11 months ago

Version

v2.41

Flavor

CLI (Command-Line Interface)

Platform

Debian

Export format

No response

Steps to reproduce

  1. Input command to back up group chat (dotnet DiscordChatExporter.Cli.dll export -t a -c a
  2. Have it appear to work for a bit, then spit out an error.

Details

Instead of archiving a group chat, it gives this error.

ERROR
System.ArgumentException: Task name cannot be empty (Parameter 'description')
  at Spectre.Console.ProgressTask..ctor(Int32 id, String description, Double maxValue, Boolean autoStart) in /_/src/Spectre.Console/Live/Progress/ProgressTask.cs:116
  at Spectre.Console.ProgressContext.AddTask(String description, ProgressTaskSettings settings) in /_/src/Spectre.Console/Live/Progress/ProgressContext.cs:58
  at DiscordChatExporter.Cli.Utils.Extensions.ConsoleExtensions.StartTaskAsync(ProgressContext progressContext, String description, Func`2 performOperationAsync) in /D:\a\DiscordChatExporter\DiscordChatExporter\DiscordChatExporter.Cli\Utils\Extensions\ConsoleExtensions.cs:39
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.<>c__DisplayClass63_1.<<ExportAsync>b__1>d.MoveNext() in /D:\a\DiscordChatExporter\DiscordChatExporter\DiscordChatExporter.Cli\Commands\Base\ExportCommandBase.cs:202
  at System.Threading.Tasks.Parallel.<>c__50`1.<<ForEachAsync>b__50_0>d.MoveNext() 
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.<>c__DisplayClass63_0.<<ExportAsync>b__0>d.MoveNext() in /D:\a\DiscordChatExporter\DiscordChatExporter\DiscordChatExporter.Cli\Commands\Base\ExportCommandBase.cs:191
  at Spectre.Console.Progress.<>c__DisplayClass27_0.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:98
  at Spectre.Console.Progress.<>c__DisplayClass28_0`1.<<StartAsync>b__0>d.MoveNext() in /_/src/Spectre.Console/Live/Progress/Progress.cs:133
  at Spectre.Console.Internal.DefaultExclusivityMode.RunAsync[T](Func`1 func) in /_/src/Spectre.Console/Internal/DefaultExclusivityMode.cs:40
  at Spectre.Console.Progress.StartAsync[T](Func`2 action) in /_/src/Spectre.Console/Live/Progress/Progress.cs:116
  at Spectre.Console.Progress.StartAsync(Func`2 action) in /_/src/Spectre.Console/Live/Progress/Progress.cs:96
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.ExportAsync(IConsole console, IReadOnlyList`1 channels) in /D:\a\DiscordChatExporter\DiscordChatExporter\DiscordChatExporter.Cli\Commands\Base\ExportCommandBase.cs:181
  at DiscordChatExporter.Cli.Commands.Base.ExportCommandBase.ExportAsync(IConsole console, IReadOnlyList`1 channelIds) in /D:\a\DiscordChatExporter\DiscordChatExporter\DiscordChatExporter.Cli\Commands\Base\ExportCommandBase.cs:315
  at DiscordChatExporter.Cli.Commands.ExportChannelsCommand.ExecuteAsync(IConsole console) in /D:\a\DiscordChatExporter\DiscordChatExporter\DiscordChatExporter.Cli\Commands\ExportChannelsCommand.cs:25
  at CliFx.CliApplication.RunAsync(ApplicationSchema applicationSchema, CommandInput commandInput) in /_/CliFx/CliApplication.cs:153
  at CliFx.CliApplication.RunAsync(IReadOnlyList`1 commandLineArguments, IReadOnlyDictionary`2 environmentVariables) in /_/CliFx/CliApplication.cs:193

No clue what I did wrong. It archives normal channels fine.

Checklist

Tyrrrz commented 11 months ago

Looks like this somehow produces an empty string: https://github.com/Tyrrrz/DiscordChatExporter/blob/16d44ce654cd4d5aae2080537e43d4101fa15640/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs#L203

Which is rather unusual. It would imply that the channel name is empty as well:

https://github.com/Tyrrrz/DiscordChatExporter/blob/16d44ce654cd4d5aae2080537e43d4101fa15640/DiscordChatExporter.Core/Discord/Data/Channel.cs#L52-L53

I assume that group does have a name though?

gmhuestis commented 11 months ago

I am seeing the same error. It works in 2.40.4. It does appear that some channel names are blank, and in 2.40.4 the dm channel names are prepended "Group" or "Private" to the name, so ProgressTask was still passed the "Group" or "Private" string even on empty names.

Tyrrrz commented 11 months ago

Can you try the latest CI build and see if it works?