Exemplo n.º 1
0
 def addingLoop(self):
     for person in self.addQueue:
         Client.addUsersToGroup(self, person, CONF_ID)
Exemplo n.º 2
0
                      thread_id=thread_id,
                      thread_type=thread_type)

# Will download the image at the url `<image url>`, and then send it
client.sendRemoteImage('<image url>',
                       message=Message(text='This is a remote image'),
                       thread_id=thread_id,
                       thread_type=thread_type)

# Only do these actions if the thread is a group
if thread_type == ThreadType.GROUP:
    # Will remove the user with ID `<user id>` from the thread
    client.removeUserFromGroup('<user id>', thread_id=thread_id)

    # Will add the user with ID `<user id>` to the thread
    client.addUsersToGroup('<user id>', thread_id=thread_id)

    # Will add the users with IDs `<1st user id>`, `<2nd user id>` and `<3th user id>` to the thread
    client.addUsersToGroup(['<1st user id>', '<2nd user id>', '<3rd user id>'],
                           thread_id=thread_id)

# Will change the nickname of the user `<user_id>` to `<new nickname>`
client.changeNickname('<new nickname>',
                      '<user id>',
                      thread_id=thread_id,
                      thread_type=thread_type)

# Will change the title of the thread to `<title>`
client.changeThreadTitle('<title>',
                         thread_id=thread_id,
                         thread_type=thread_type)
Exemplo n.º 3
0
    def addingLoop(self):
        while(self.addQueue.__len__() != 0):
            Client.addUsersToGroup(self, self.addQueue.pop(), self.CONF_ID)

        self.addFlag = False
Exemplo n.º 4
0
# Will download the image at the URL `<image url>`, and then send it
client.sendRemoteImage(
    "<image url>",
    message=Message(text="This is a remote image"),
    thread_id=thread_id,
    thread_type=thread_type,
)

# Only do these actions if the thread is a group
if thread_type == ThreadType.GROUP:
    # Will remove the user with ID `<user id>` from the thread
    client.removeUserFromGroup("<user id>", thread_id=thread_id)

    # Will add the user with ID `<user id>` to the thread
    client.addUsersToGroup("<user id>", thread_id=thread_id)

    # Will add the users with IDs `<1st user id>`, `<2nd user id>` and `<3th user id>` to the thread
    client.addUsersToGroup(["<1st user id>", "<2nd user id>", "<3rd user id>"],
                           thread_id=thread_id)

# Will change the nickname of the user `<user_id>` to `<new nickname>`
client.changeNickname("<new nickname>",
                      "<user id>",
                      thread_id=thread_id,
                      thread_type=thread_type)

# Will change the title of the thread to `<title>`
client.changeThreadTitle("<title>",
                         thread_id=thread_id,
                         thread_type=thread_type)