removing that reddit shit

This commit is contained in:
Luke Robles 2018-12-27 20:19:28 -08:00
parent 3a0095e9de
commit c215c1a7a5

View File

@ -104,17 +104,6 @@ async def on_message(message):
)
)
# Read messages and look for mentions of subreddits
for word in message.content.split():
if (message.author != client.user) and '/r/' in word:
try:
subreddit = word.split('/')[-1]
# check if that subreddit exists by querying the length of this json blob
if len(requests.get("https://reddit.com/r/{}.json".format(subreddit), headers={'User-agent':'dragon-bot'}).json()['data']['children']):
await client.send_message(message.channel, "https://reddit.com/r/{}".format(subreddit))
except:
pass
if message.content.startswith('!8ball'):
await client.send_message(
message.channel,