Add DynamoDb support

This commit is contained in:
2020-04-30 22:25:20 -04:00
parent c85d5cada4
commit 7016926c3d
22 changed files with 84 additions and 20 deletions

40
groupme.py Normal file
View File

@@ -0,0 +1,40 @@
from groupy import Client
import constants
GROUPME_CLIENT: Client = None
def init_client():
global GROUPME_CLIENT
GROUPME_CLIENT = Client.from_token(constants.GROUPME)
def get_client():
if GROUPME_CLIENT is None:
init_client()
return GROUPME_CLIENT
def get_group(group_name):
found_group = Exception("Input group not found")
if GROUPME_CLIENT is None:
init_client()
group_list = GROUPME_CLIENT.groups.list(per_page=50)
for ret_group in group_list:
if group_name.casefold() == ret_group.name.casefold():
found_group = ret_group
break
return found_group
def get_bot(bot_name):
found_bot = Exception("Input bot not found")
if GROUPME_CLIENT is None:
init_client()
bot_list = GROUPME_CLIENT.bots.list()
for ret_bot in bot_list:
if bot_name.casefold() == ret_bot.name.casefold():
found_bot = ret_bot
break
return found_bot