aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Rohan <[email protected]>2021-04-20 15:27:52 +0530
committerGravatar rohan <[email protected]>2021-04-28 11:42:04 +0530
commit94cde71acb319a63eba50baa3408c12278c0a4ab (patch)
tree8da4269097bc6a483133547b7aaa6cf7a52c0390
parentDelete reddit cog. (diff)
Remove reddit references.
-rw-r--r--bot/constants.py9
-rw-r--r--bot/converters.py29
-rw-r--r--bot/utils/time.py2
-rw-r--r--config-default.yml8
4 files changed, 1 insertions, 47 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 6d14bbb3a..093321196 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -467,7 +467,6 @@ class Webhooks(metaclass=YAMLGetter):
dev_log: int
duck_pond: int
incidents_archive: int
- reddit: int
talent_pool: int
@@ -546,14 +545,6 @@ class URLs(metaclass=YAMLGetter):
paste_service: str
-class Reddit(metaclass=YAMLGetter):
- section = "reddit"
-
- client_id: Optional[str]
- secret: Optional[str]
- subreddits: list
-
-
class AntiSpam(metaclass=YAMLGetter):
section = 'anti_spam'
diff --git a/bot/converters.py b/bot/converters.py
index 3bf05cfb3..2a3943831 100644
--- a/bot/converters.py
+++ b/bot/converters.py
@@ -236,35 +236,6 @@ class Snowflake(IDConverter):
return snowflake
-class Subreddit(Converter):
- """Forces a string to begin with "r/" and checks if it's a valid subreddit."""
-
- @staticmethod
- async def convert(ctx: Context, sub: str) -> str:
- """
- Force sub to begin with "r/" and check if it's a valid subreddit.
-
- If sub is a valid subreddit, return it prepended with "r/"
- """
- sub = sub.lower()
-
- if not sub.startswith("r/"):
- sub = f"r/{sub}"
-
- resp = await ctx.bot.http_session.get(
- "https://www.reddit.com/subreddits/search.json",
- params={"q": sub}
- )
-
- json = await resp.json()
- if not json["data"]["children"]:
- raise BadArgument(
- f"The subreddit `{sub}` either doesn't exist, or it has no posts."
- )
-
- return sub
-
-
class TagNameConverter(Converter):
"""
Ensure that a proposed tag name is valid.
diff --git a/bot/utils/time.py b/bot/utils/time.py
index 466f0adc2..3c14b8fba 100644
--- a/bot/utils/time.py
+++ b/bot/utils/time.py
@@ -144,7 +144,7 @@ def parse_rfc1123(stamp: str) -> datetime.datetime:
return datetime.datetime.strptime(stamp, RFC1123_FORMAT).replace(tzinfo=datetime.timezone.utc)
-# Hey, this could actually be used in the off_topic_names and reddit cogs :)
+# Hey, this could actually be used in the off_topic_names cog :)
async def wait_until(time: datetime.datetime, start: Optional[datetime.datetime] = None) -> None:
"""
Wait until a given time.
diff --git a/config-default.yml b/config-default.yml
index 8c6e18470..2b5cad1dc 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -288,7 +288,6 @@ guild:
duck_pond: 637821475327311927
incidents_archive: 720671599790915702
python_news: &PYNEWS_WEBHOOK 704381182279942324
- reddit: 635408384794951680
talent_pool: 569145364800602132
@@ -418,13 +417,6 @@ anti_spam:
max: 3
-reddit:
- client_id: !ENV "REDDIT_CLIENT_ID"
- secret: !ENV "REDDIT_SECRET"
- subreddits:
- - 'r/Python'
-
-
big_brother:
header_message_limit: 15
log_delay: 15