Use C#9 features

This commit is contained in:
Tyrrrz 2020-12-14 17:45:42 +02:00
parent 9dda9cfc27
commit 63803f98aa
18 changed files with 99 additions and 71 deletions

View file

@ -44,7 +44,7 @@ namespace DiscordChatExporter.Cli.Commands.Base
Description = "Format used when writing dates.")]
public string DateFormat { get; set; } = "dd-MMM-yy hh:mm tt";
protected ChannelExporter GetChannelExporter() => new ChannelExporter(GetDiscordClient());
protected ChannelExporter GetChannelExporter() => new(GetDiscordClient());
protected async ValueTask ExportAsync(IConsole console, Guild guild, Channel channel)
{

View file

@ -17,14 +17,14 @@ namespace DiscordChatExporter.Cli.Commands.Base
Description = "Authorize as a bot.")]
public bool IsBotToken { get; set; }
protected AuthToken GetAuthToken() => new AuthToken(
protected AuthToken GetAuthToken() => new(
IsBotToken
? AuthTokenType.Bot
: AuthTokenType.User,
TokenValue
);
protected DiscordClient GetDiscordClient() => new DiscordClient(GetAuthToken());
protected DiscordClient GetDiscordClient() => new(GetAuthToken());
public abstract ValueTask ExecuteAsync(IConsole console);
}