Add framework for using reddit

dev
pocketjawa 2017-02-28 23:08:35 -05:00
parent d0c20b178a
commit 660c3106d5
2 changed files with 12 additions and 1 deletions

View File

@ -7,4 +7,8 @@
token: token:
#Channel IDs #Channel IDs
bot_channel_id: bot_channel_id:
#Reddit Stuff
reddit_client_id:
reddit_client_secret:

View File

@ -5,6 +5,7 @@ import configparser
import datetime import datetime
import random import random
import xkcd import xkcd
import praw
#Import config file #Import config file
config = configparser.ConfigParser() config = configparser.ConfigParser()
@ -13,6 +14,12 @@ config.read("/srv/discord-pocketbot/config.cfg")
token = config.get("configuration", "token") token = config.get("configuration", "token")
bot_channel_id = discord.Object(id=config.get("configuration", "bot_channel_id")) bot_channel_id = discord.Object(id=config.get("configuration", "bot_channel_id"))
#Reddit Setup
reddit_client_id = config.get("configuration", "reddit_client_id")
reddit_client_secret = config.get("configuration", "reddit_client_secret")
reddit_user_agent = 'linux:com.pocketjawa.discord-pocketbot:v0.1 (by /u/pocketjava)'
reddit = praw.Reddit(client_id=reddit_client_id,client_secret=reddit_client_secret,user_agent=reddit_user_agent)
client = discord.Client() client = discord.Client()
#Subroutine to get UPS Status #Subroutine to get UPS Status