-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathgroupsMethods.py
More file actions
33 lines (26 loc) · 837 Bytes
/
Copy pathgroupsMethods.py
File metadata and controls
33 lines (26 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from whatsapp_api_client_python import API
greenAPI = API.GreenAPI(
"1101000001", "d75b3a66374942c5b3c019c698abc2067e151558acbd412345"
)
def main():
# Allow only admins to send messages
response = greenAPI.groups.updateGroupSettings(
"1234567890@g.us",
allowParticipantsSendMessages=False
)
print(response.data)
# Allow participants to edit group settings
response = greenAPI.groups.updateGroupSettings(
"1234567890@g.us",
allowParticipantsEditGroupSettings=True
)
print(response.data)
# Change both settings at once
response = greenAPI.groups.updateGroupSettings(
"1234567890@g.us",
allowParticipantsEditGroupSettings=False,
allowParticipantsSendMessages=True
)
print(response.data)
if __name__ == '__main__':
main()