Exemple #1
0
    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()
Exemple #2
0
    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()
Exemple #3
0
    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
Exemple #4
0
    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