Refactor CLI and add 'exportdm' command to export all direct message channels

This commit is contained in:
Oleksii Holub 2018-12-19 17:29:36 +02:00
parent e22e1c03fb
commit 13925c69af
8 changed files with 100 additions and 9 deletions

View file

@ -37,7 +37,8 @@ namespace DiscordChatExporter.Cli
// Get all verb types
var verbTypes = new[]
{
typeof(ExportChatOptions),
typeof(ExportChannelOptions),
typeof(ExportDirectMessagesOptions),
typeof(ExportGuildOptions),
typeof(GetChannelsOptions),
typeof(GetDirectMessageChannelsOptions),
@ -48,7 +49,8 @@ namespace DiscordChatExporter.Cli
var parsedArgs = Parser.Default.ParseArguments(args, verbTypes);
// Execute commands
parsedArgs.WithParsed<ExportChatOptions>(o => new ExportChatVerb(o).Execute());
parsedArgs.WithParsed<ExportChannelOptions>(o => new ExportChannelVerb(o).Execute());
parsedArgs.WithParsed<ExportDirectMessagesOptions>(o => new ExportDirectMessagesVerb(o).Execute());
parsedArgs.WithParsed<ExportGuildOptions>(o => new ExportGuildVerb(o).Execute());
parsedArgs.WithParsed<GetChannelsOptions>(o => new GetChannelsVerb(o).Execute());
parsedArgs.WithParsed<GetDirectMessageChannelsOptions>(o => new GetDirectMessageChannelsVerb(o).Execute());