removing that reddit shit
This commit is contained in:
parent
3a0095e9de
commit
c215c1a7a5
@ -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'):
|
if message.content.startswith('!8ball'):
|
||||||
await client.send_message(
|
await client.send_message(
|
||||||
message.channel,
|
message.channel,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user