mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-03 08:08:40 -04:00
Use C#9 features
This commit is contained in:
parent
9dda9cfc27
commit
63803f98aa
18 changed files with 99 additions and 71 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue