Tyrrrz / DiscordChatExporter

Exports Discord chat logs to a file
MIT License
7.51k stars 683 forks source link

`FUCK_RUSSIA` is too strict on boolean values #1019

Closed ctrlcctrlv closed 1 year ago

ctrlcctrlv commented 1 year ago

Version

master

Flavor

CLI (Command-Line Interface)

Export format

No response

Details

% export FUCK_RUSSIA=1
% ./bin/Debug/net7.0/DiscordChatExporter.Cli export
Option --fuck-russia cannot be set from the provided argument(s):
<1>
Error: String '1' was not recognized as a valid Boolean.

DiscordChatExporter.Cli v2.39.1

USAGE
  dotnet DiscordChatExporter.Cli.dll export --channel <values...> --token <value> [options]

DESCRIPTION
  Export one or multiple channels.

OPTIONS
* -c|--channel      Channel ID(s). If provided with category IDs, all channels inside those categories will be exported. 
* -t|--token        Authentication token. Environment variable: DISCORD_TOKEN. 
  -o|--output       Output file or directory path. If a directory is specified, file names will be generated automatically based on the channel names and other parameters. Directory path should end with a slash to avoid ambiguity. Supports template tokens, see the documentation for more info. Default: "/home/fred/Workspace/DiscordChatExporter/DiscordChatExporter.Cli".
  -f|--format       Export format. Choices: "PlainText", "HtmlDark", "HtmlLight", "Csv", "Json". Default: "HtmlDark".
  --after           Only include messages sent after this date or message ID. 
  --before          Only include messages sent before this date or message ID. 
  -p|--partition    Split output into partitions, each limited to this number of messages (e.g. '100') or file size (e.g. '10mb'). 
  --filter          Only include messages that satisfy this filter (e.g. 'from:foo#1234' or 'has:image'). 
  --parallel        Limits how many channels can be exported in parallel. Default: "1".
  --markdown        Process markdown, mentions, and other special tokens. Default: "True".
  --media           Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: "False".
  --reuse-media     Reuse previously downloaded assets to avoid redundant requests. Default: "False".
  --media-dir       Download assets to this directory. If not specified, the asset directory path will be derived from the output path. 
  --dateformat      Format used when writing dates. Default: "MM/dd/yyyy h:mm tt".
  --fuck-russia     Don't print the Support Ukraine message to the console. Environment variable: FUCK_RUSSIA. Default: "False".
  -b|--bot          This option doesn't do anything. Kept for backwards compatibility. Environment variable: DISCORD_TOKEN_BOT. Default: "False".
  -h|--help         Shows help text. 

Steps to reproduce

see above

Tyrrrz commented 1 year ago

Thank you for reporting

ctrlcctrlv commented 1 year ago

That does not solve the issue. Having the env var is good, the problem is it's too strict.

ctrlcctrlv commented 1 year ago

It works if FUCK_RUSSIA=TRUE for example, so it isn't totally broken.

Tyrrrz commented 1 year ago

That does not solve the issue. Having the env var is good, the problem is it's too strict.

The proper solution has to be implemented in CliFx, so I reverted it for now

Tyrrrz commented 1 year ago

Please try latest again