Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework the CLI commands to be more composable #1210

Open
Tyrrrz opened this issue Mar 18, 2024 · 1 comment
Open

Rework the CLI commands to be more composable #1210

Tyrrrz opened this issue Mar 18, 2024 · 1 comment

Comments

@Tyrrrz
Copy link
Owner

Tyrrrz commented Mar 18, 2024

Currently, we have commands like exportguild, exportall, exportdm which allow the user to export batches of channels. There are some filtering options available in those commands (such as --include-vc, --include-threads, etc), but they are not very composable.

If the user wants to have full control over which channels they want to export, the recommended approach is to use the channels command to fetch all channels (with some filtering available too), and then manually plug the IDs into the export command.

We can streamline this flow by making the channels command more configurable in terms of filters and, most importantly, making its output pipe-able into export. The idea is that the export command will not have any filtering options whatsoever (and exportguild, exportall, exportdm will be completely removed), but instead the user can pipe the result of channels directly.

For example:

$ dotnet DiscordChatExporter.dll channels --guild 123456 --token 123456 --include-threads --include-dm | dotnet DiscordChatExporter.dll export --token 123456

(to avoid repeating the --token twice, you can set it as an environment variable)

The channels command can detect if its output is being redirected and change the format to only produce channel IDs, separated by newlines. If the output is not redirected, then the current, info-rich and user-friendly format is used. We can also add command options to control this behavior explicitly.

@CanePlayz
Copy link
Contributor

Sounds great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants