From ab223a142057919f3238e617b33bf73807e3f111 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 14 Jan 2020 12:20:27 +0000 Subject: [PATCH] rotten --- trifling.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/trifling.py b/trifling.py index 654ac27..c9e3cc0 100644 --- a/trifling.py +++ b/trifling.py @@ -521,6 +521,19 @@ def romerito(bot, trigger): silly_string = "Et tu, Romerito!" bot.say(silly_string) +@sopel.module.commands('rotten') +def rotten(bot, trigger): + reddit = praw.Reddit(client_id=client.client_id, client_secret=client.client_secret, user_agent='asdfasdfasdfjhwrgth', username=client.username, password=client.password) + try: + sub=reddit.subreddit('4chan') + posts=sub.hot(limit=100) + n=random.randint(0,100) + for i, post in enumerate(posts): + if i==n: + bot.say(post.url) + except: + bot.say("Something something reddit's servers") + @sopel.module.commands('ryo') def ryo(bot, trigger): bot.say(u'https://i.imgflip.com/2nn22t.jpg')