ayn2op / discordo

A lightweight, secure, and feature-rich Discord terminal client.
MIT License
2.12k stars 66 forks source link

Parse token flag before accessing keyring #359

Closed cyberme0w closed 6 months ago

cyberme0w commented 7 months ago

Hi!

I think it makes sense to check if the user provided a token flag before accessing the keyring - an actively passed flag+token should be prioritized over the (passive) keyring fallback. Furthermore, there is no need to check the keyring in the first place, given the token is already known.

This also gets rid of the (very minor) annoyance of seeing this error message if discordo is launched with the --token flag:

yyyy/mm/dd hh:mm:ss token not found in keyring: secret not found in keyring

This commit also allows for any future flags to be declared at the top of main near each other, keeping things a bit cleaner (in my opinion).

Cheers!