aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2025-01-02 19:15:11 +0000
committerGravatar Chris Lovering <[email protected]>2025-01-02 19:15:11 +0000
commit6b12cbd18e6351b45dd75ec68807b546db88da70 (patch)
tree33050e9da4a76d8449af77238303caa2dd7b02f4
parentAdd warning log if bot hits reddit ratelimit (diff)
Add env var setting to determine whether to post daily top reddit posts
-rw-r--r--bot/constants.py1
-rw-r--r--bot/exts/utilities/reddit.py3
2 files changed, 3 insertions, 1 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 6b6d1a1d..bf53c4b4 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -301,6 +301,7 @@ class _Reddit(EnvConfig, env_prefix="reddit_"):
client_id: SecretStr = ""
secret: SecretStr = ""
webhook: int = 635408384794951680
+ send_top_daily_posts: bool = True
Reddit = _Reddit()
diff --git a/bot/exts/utilities/reddit.py b/bot/exts/utilities/reddit.py
index 74927c92..bfb7337a 100644
--- a/bot/exts/utilities/reddit.py
+++ b/bot/exts/utilities/reddit.py
@@ -36,7 +36,8 @@ class Reddit(Cog):
self.access_token = None
self.client_auth = BasicAuth(RedditConfig.client_id.get_secret_value(), RedditConfig.secret.get_secret_value())
- self.auto_poster_loop.start()
+ if RedditConfig.send_top_daily_posts:
+ self.auto_poster_loop.start()
async def cog_unload(self) -> None:
"""Stop the loop task and revoke the access token when the cog is unloaded."""