Add rest of project files
This commit is contained in:
18
app/groupme.py
Normal file
18
app/groupme.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from groupy import Client
|
||||
|
||||
from util import api_keys
|
||||
|
||||
GROUPME_CLIENT = None
|
||||
|
||||
|
||||
def get_client():
|
||||
if GROUPME_CLIENT is None:
|
||||
init_client()
|
||||
return GROUPME_CLIENT
|
||||
|
||||
|
||||
def init_client():
|
||||
global GROUPME_CLIENT
|
||||
GROUPME_CLIENT = Client.from_token(api_keys.GROUPME)
|
||||
if not list(GROUPME_CLIENT.groups.list_all()):
|
||||
raise Exception("Invalid groupme token or not apart of any groups.")
|
||||
Reference in New Issue
Block a user