aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2023-05-06 12:31:52 +0100
committerGravatar shtlrs <[email protected]>2023-05-06 13:20:47 +0100
commit817247bbb6c1274ef1de1815ea13c69e093f79fc (patch)
tree51484ca864fd6b78aa0949cc3ba09c6c14ecd43d /bot
parentuse `SecretStr` for all secrets (diff)
give empty str as default to tokens
Diffstat (limited to 'bot')
-rw-r--r--bot/constants.py28
-rw-r--r--bot/exts/utilities/wolfram.py4
2 files changed, 15 insertions, 17 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 80ebf077..c16faa9b 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -116,9 +116,6 @@ class _Client(EnvConfig):
Client = _Client()
-print(Client.token)
-print(Client.token.get_secret_value())
-
class _Logging(EnvConfig):
EnvConfig.Config.env_prefix = "logging_"
@@ -289,15 +286,15 @@ Roles = _Roles()
class _Tokens(EnvConfig):
EnvConfig.Config.env_prefix = "tokens_"
- giphy: SecretStr | None
- youtube: SecretStr | None
- tmdb: SecretStr | None
- nasa: SecretStr | None
- igdb_client_id: SecretStr | None
- igdb_client_secret: SecretStr | None
- github: SecretStr | None
- unsplash: SecretStr | None
- wolfram: SecretStr | None
+ giphy: SecretStr = ""
+ youtube: SecretStr = ""
+ tmdb: SecretStr = ""
+ nasa: SecretStr = ""
+ igdb_client_id: SecretStr = ""
+ igdb_client_secret: SecretStr = ""
+ github: SecretStr = ""
+ unsplash: SecretStr = ""
+ wolfram: SecretStr = ""
Tokens = _Tokens()
@@ -307,6 +304,7 @@ class _Wolfram(EnvConfig):
EnvConfig.Config.env_prefix = "wolfram_"
user_limit_day = 10
guild_limit_day = 67
+ key: SecretStr = ""
Wolfram = _Wolfram()
@@ -317,7 +315,7 @@ class _Redis(EnvConfig):
host = "redis.default.svc.cluster.local"
port = 6379
- password: SecretStr | None
+ password: SecretStr = ""
use_fakeredis = False
@@ -338,8 +336,8 @@ class _Reddit(EnvConfig):
subreddits = ["r/Python"]
- client_id: SecretStr | None
- secret: SecretStr | None
+ client_id: SecretStr = ""
+ secret: SecretStr = ""
webhook = 635408384794951680
diff --git a/bot/exts/utilities/wolfram.py b/bot/exts/utilities/wolfram.py
index d06e8f03..a036b50f 100644
--- a/bot/exts/utilities/wolfram.py
+++ b/bot/exts/utilities/wolfram.py
@@ -10,12 +10,12 @@ from discord.ext import commands
from discord.ext.commands import BucketType, Cog, Context, check, group
from bot.bot import Bot
-from bot.constants import Colours, STAFF_ROLES, Tokens, Wolfram
+from bot.constants import Colours, STAFF_ROLES, Wolfram
from bot.utils.pagination import ImagePaginator
log = logging.getLogger(__name__)
-APPID = Tokens.wolfram.get_secret_value()
+APPID = Wolfram.key.get_secret_value()
DEFAULT_OUTPUT_FORMAT = "JSON"
QUERY = "http://api.wolframalpha.com/v2/{request}"
WOLF_IMAGE = "https://www.symbols.com/gi.php?type=1&id=2886&i=1"