Telegram version of schneiderbot. I'll totally do something w/ this, this is never going to be effectively a mirror.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
631 B

import praw
def get_reddit_instance():
reddit_config = {}
with open("reddit_config") as tmp_file:
for line in tmp_file:
(key, val) = line.split(';')
reddit_config[key] = val.replace('\n', '')
return praw.Reddit(
user_agent=reddit_config['user_agent'],
client_id=reddit_config['client_id'],
client_secret=reddit_config['client_secret']
)
def wrong_dog(bot, update):
reddit = get_reddit_instance()
sub = reddit.subreddit('whatswrongwithyourdog')
post = sub.random()
update.message.reply_text("This dog has serious issues: %s" % post.url)