def addGroupsWithIds(self, group_ids, is_joined=True): """Refresh groups of LineClient""" new_groups = self._getGroups(group_ids) self.groups += [LineGroup(self, group, is_joined) for group in new_groups] self.groups.sort()
def addGroupsWithIds(self, group_ids, is_joined=True): """Refresh groups of LineClient""" if self._check_auth(): new_groups = self._getGroups(group_ids) for group in new_groups: self.groups.append(LineGroup(self, group, is_joined)) self.groups.sort()
def createGroupWithIds(self, name, ids=[]): """Create a group with contact ids :param name: name of group :param ids: list of contact ids """ try: group = LineGroup(self, self._createGroup(name, ids)) self.groups.append(group) return group except Exception as e: self.raise_error(e) return None
def createGroupWithContacts(self, name, contacts=[]): """Create a group with contacts :param name: name of group :param contacts: list of contacts """ try: contact_ids = [] for contact in contacts: contact_ids.append(contact.id) group = LineGroup(self, self._createGroup(name, contact_ids)) self.groups.append(group) return group except Exception as e: self.raise_error(e) return None