Discord-Scraper icon indicating copy to clipboard operation
Discord-Scraper copied to clipboard

Improve upon the configuration method.

Open Dracovian opened this issue 4 years ago • 0 comments

So I'm going to be delving into adding commandline flags to generate a configuration for the script upon the first run.

If I ever plan on writing a GUI frontend for this script (I'm definitely not ready for that yet), then this should make it somewhat less of a headache to accomplish.

This means that the README contents will certainly require a refresher since it will no longer be applicable to the new script.

Here's what I have planned thus far:

python discord.py
    -h, --help           : Show this help text.
    -v, --version        : Show the script version.
    -V, --verbose        : Print out all debug information.
    -t, --test           : Test the validity of the config data and exit.
    -nc, --no-cache      : Do not create a cache for JSON contents.
    -c, --only-cache     : Do not attempt to download binary contents, just cache JSON data.

    --token=             : Set the authorization token to be used.
    --agent=             : Set a custom user-agent for web requests.
    --proxy=             : Set a custom HTTP proxy server for web requests.
    
    --add-guild          : Prompt the user for a guild ID and name to add to the config data.
    --add-channel        : Prompt the user for a channel ID and name to add to the config data.

    --list-guilds        : List all of the guilds in the config data and their corresponding channels.
    --clear-cache        : Delete the contents of the JSON cache directory.
    --clear-config       : Delete the contents of the config data.

    --update-guild       : Prompt the user for a guild ID to change the guild name in the config data.
    --update-channel     : Prompt the user for a guild and channel ID to change the channel name in the config data.

    --remove-guild       : Prompt the user for a guild ID to remove the guild from the config data.
    --remove-channel     : Prompt the user for a guild and channel ID to remove the channel from the config data.

    --delete-guild       : An alias of remove-guild
    --delete-channel     : An alias of remove-channel

    --trim-cache         : Only remove JSON files from the cache if they are associated with channels and/or guilds that are no longer listed in the config data.

I'll make this more efficient by pushing the more commonly used flags to the top of the help text. These are bound to change over time of course, but let me know what you think of the planned flags above.

Dracovian avatar Apr 23 '20 11:04 Dracovian