aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/fun
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2023-05-06 13:36:52 +0100
committerGravatar GitHub <[email protected]>2023-05-06 13:36:52 +0100
commite2d0c268732ab6998a90028be9ecd1f8efcce7d8 (patch)
treeea0fc0176f18331756c19d110ee6edf4e5100898 /bot/exts/fun
parentBump pre-commit from 3.3.0 to 3.3.1 (#1263) (diff)
parentbump bot-core to 9.6.0 (diff)
Merge pull request #1260 from shtlrs/pedantic-configuration
Use pydantic for configuration management
Diffstat (limited to 'bot/exts/fun')
-rw-r--r--bot/exts/fun/game.py4
-rw-r--r--bot/exts/fun/movie.py4
-rw-r--r--bot/exts/fun/snakes/_snakes_cog.py6
-rw-r--r--bot/exts/fun/space.py2
4 files changed, 8 insertions, 8 deletions
diff --git a/bot/exts/fun/game.py b/bot/exts/fun/game.py
index a8b0b3a0..c38dc063 100644
--- a/bot/exts/fun/game.py
+++ b/bot/exts/fun/game.py
@@ -20,8 +20,8 @@ from bot.utils.pagination import ImagePaginator, LinePaginator
# Base URL of IGDB API
BASE_URL = "https://api.igdb.com/v4"
-CLIENT_ID = Tokens.igdb_client_id
-CLIENT_SECRET = Tokens.igdb_client_secret
+CLIENT_ID = Tokens.igdb_client_id.get_secret_value()
+CLIENT_SECRET = Tokens.igdb_client_secret.get_secret_value()
# The number of seconds before expiry that we attempt to re-fetch a new access token
ACCESS_TOKEN_RENEWAL_WINDOW = 60*60*24*2
diff --git a/bot/exts/fun/movie.py b/bot/exts/fun/movie.py
index 422a83ac..73ef0a3c 100644
--- a/bot/exts/fun/movie.py
+++ b/bot/exts/fun/movie.py
@@ -22,7 +22,7 @@ THUMBNAIL_URL = "https://i.imgur.com/LtFtC8H.png"
# Define movie params, that will be used for every movie request
MOVIE_PARAMS = {
- "api_key": Tokens.tmdb,
+ "api_key": Tokens.tmdb.get_secret_value(),
"language": "en-US"
}
@@ -106,7 +106,7 @@ class Movie(Cog):
"""Return JSON of TMDB discover request."""
# Define params of request
params = {
- "api_key": Tokens.tmdb,
+ "api_key": Tokens.tmdb.get_secret_value(),
"language": "en-US",
"sort_by": "popularity.desc",
"include_adult": "false",
diff --git a/bot/exts/fun/snakes/_snakes_cog.py b/bot/exts/fun/snakes/_snakes_cog.py
index d0542c23..892a3dd2 100644
--- a/bot/exts/fun/snakes/_snakes_cog.py
+++ b/bot/exts/fun/snakes/_snakes_cog.py
@@ -773,7 +773,7 @@ class Snakes(Cog):
"query": "snake",
"page": page,
"language": "en-US",
- "api_key": Tokens.tmdb,
+ "api_key": Tokens.tmdb.get_secret_value(),
}
)
data = await response.json()
@@ -785,7 +785,7 @@ class Snakes(Cog):
f"https://api.themoviedb.org/3/movie/{movie}",
params={
"language": "en-US",
- "api_key": Tokens.tmdb,
+ "api_key": Tokens.tmdb.get_secret_value(),
}
)
data = await response.json()
@@ -1095,7 +1095,7 @@ class Snakes(Cog):
"part": "snippet",
"q": urllib.parse.quote_plus(query),
"type": "video",
- "key": Tokens.youtube
+ "key": Tokens.youtube.get_secret_value()
}
)
response = await response.json()
diff --git a/bot/exts/fun/space.py b/bot/exts/fun/space.py
index 22a89050..c688b281 100644
--- a/bot/exts/fun/space.py
+++ b/bot/exts/fun/space.py
@@ -210,7 +210,7 @@ class Space(Cog):
"""Fetch information from NASA API, return result."""
params = {}
if use_api_key:
- params["api_key"] = Tokens.nasa
+ params["api_key"] = Tokens.nasa.get_secret_value()
# Add additional parameters to request parameters only when they provided by user
if additional_params is not None: