Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions bot/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,6 @@ class Emojis(metaclass=YAMLGetter):
new: str
pencil: str

comments: str
upvotes: str
user: str

ok_hand: str


Expand Down Expand Up @@ -471,7 +467,6 @@ class Webhooks(metaclass=YAMLGetter):
dev_log: int
duck_pond: int
incidents_archive: int
reddit: int
talent_pool: int


Expand Down Expand Up @@ -551,14 +546,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'

Expand Down
29 changes: 0 additions & 29 deletions bot/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,35 +236,6 @@ async def convert(self, ctx: Context, arg: str) -> int:
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.
Expand Down
308 changes: 0 additions & 308 deletions bot/exts/info/reddit.py

This file was deleted.

Loading