19 lines
407 B
Python
19 lines
407 B
Python
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.")
|