SEbbaDK / sonica

Music playing daemon and clients, acting as a FOSS party music player alternative to Spotify playlists.
GNU General Public License v3.0
4 stars 0 forks source link

Optional loading of command line arguments from files #39

Closed NastyLad closed 3 years ago

NastyLad commented 3 years ago

Initial fix for #11. Adds the possibility of excluding deez_ARL and bot_tokens from command line when starting Sonica if you have them specified in .deezerARL and .botToken files.

NastyLad commented 3 years ago

There's an edge-case for if no bot token is provided in terminal, and there also isn't a token file, but I don't think that's much of a problem.

Do we need to handle that scenario? If there is no file, and you refrain from providing a token via the command line, you'd be given an error there automatically.

NastyLad commented 3 years ago

Errors should have been fixed now. I've tried running Sonica on my machine and it reports no errrors. I might change the code to make use of callback functions at a later time, but for now, it works according to intention.

Rawrior commented 3 years ago

I think current commit just ends in some error if there is neither a terminal argument nor a file. I think typer maybe intercepts the error somehow, because when testing, the error that was previously raised from bot_token_auto() turned into an AttributeError at bot.run(api), instead of the RuntimeError that it should have been.