diff options
| author | 2020-02-26 10:43:38 +0100 | |
|---|---|---|
| committer | 2020-02-26 10:43:38 +0100 | |
| commit | f87a53ff442bc10cd2cba87943e40c531e0ce9ba (patch) | |
| tree | 3a4848508a660e0c46369fe3d252b9c987be227e | |
| parent | Specify the logged time is in UTC. (diff) | |
Check for falsy values instead of ``""` and `None` explicitly.
After the change to also check empty strings to avoid unucessary requests, it is no longer necessary to do an explicit value check, as the only values that can come from the .env file are `None` and strings
Co-authored-by: Karlis S <[email protected]>
| -rw-r--r-- | bot/cogs/reddit.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/cogs/reddit.py b/bot/cogs/reddit.py index 22e5c2a9c..6d03928e0 100644 --- a/bot/cogs/reddit.py +++ b/bot/cogs/reddit.py @@ -290,8 +290,7 @@ class Reddit(Cog): def setup(bot: Bot) -> None: """Load the Reddit cog.""" - invalid_values = "", None - if any(value in (RedditConfig.secret, RedditConfig.client_id) for value in invalid_values): + if not RedditConfig.secret or not RedditConfig.client_id: log.error("Credentials not provided, cog not loaded.") return bot.add_cog(Reddit(bot)) |