def getMembersByGroupID(gID): if request.method == 'GET': return GroupHandler().getGroupMembersByGroupID(gID) if request.method == 'POST': return GroupHandler().addMember(gID, request.json) if request.method == 'DELETE': return GroupHandler().removeMember(gID, request.json)
def getGroup(): if request.method == 'GET': return GroupHandler().getAllGroups() if request.method == 'POST': return GroupHandler().createGroup(request.json) if request.method == 'DELETE': return GroupHandler().deleteGroup(request.json)
async def GMHandler(app: Mirai, group: Group, member: Member, message: MessageChain): if group.id not in groups: groups[group.id] = GroupHandler() TaskHandler(app, group.id) await groups[group.id].handle(app, group, member, message)
def getOwnerByGroupID(gID): return GroupHandler().getGroupOwnerByGroupID(gID)
def getGroupByID(gID): return GroupHandler().getGroupByGroupID(gID)