Skip to content

Commit 22895d1

Browse files
authored
Merge pull request #5 from Amele9/master
Fixed #4
2 parents 661853b + 758c3a5 commit 22895d1

47 files changed

Lines changed: 1140 additions & 1309 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/python-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ name: Upload Python Package
1111
on:
1212
release:
1313
types: [published]
14+
# Allows you to run this workflow manually from the Actions tab
15+
workflow_dispatch:
1416

1517
permissions:
1618
contents: read

README.md

Lines changed: 120 additions & 103 deletions
Large diffs are not rendered by default.

README_RUS.md

Lines changed: 124 additions & 105 deletions
Large diffs are not rendered by default.

examples/createGroupAndSendMessage.py

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from os import environ
2+
3+
from whatsapp_api_client_python import GreenAPI
4+
5+
# First you need to set the environment variables.
6+
ID_INSTANCE = environ["ID_INSTANCE"]
7+
API_TOKEN_INSTANCE = environ["API_TOKEN_INSTANCE"]
8+
9+
greenAPI = GreenAPI(ID_INSTANCE, API_TOKEN_INSTANCE)
10+
11+
12+
def main():
13+
create_group_response = greenAPI.groups.create_group(
14+
groupName="Group Name",
15+
chatIds=["79001234567@c.us"]
16+
)
17+
18+
print(create_group_response.data)
19+
20+
chatId = create_group_response.data["chatId"]
21+
send_message_response = greenAPI.sending.send_message(
22+
chatId=chatId,
23+
message="Any message"
24+
)
25+
26+
print(send_message_response.data)
27+
28+
29+
if __name__ == "__main__":
30+
main()

examples/receiveNotification.py

Lines changed: 0 additions & 98 deletions
This file was deleted.

examples/sendPictureByLink.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/sendPictureByUpload.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/sendTextMessage.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

examples/send_file_by_upload.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from os import environ
2+
3+
from whatsapp_api_client_python import GreenAPI
4+
5+
# First you need to set the environment variables.
6+
ID_INSTANCE = environ["ID_INSTANCE"]
7+
API_TOKEN_INSTANCE = environ["API_TOKEN_INSTANCE"]
8+
9+
greenAPI = GreenAPI(ID_INSTANCE, API_TOKEN_INSTANCE)
10+
11+
12+
def main():
13+
response = greenAPI.sending.send_file_by_upload(
14+
chatId="79001234567@c.us",
15+
path="C:\\Games\\PicFromDisk.png"
16+
)
17+
18+
print(response.data)
19+
20+
21+
if __name__ == "__main__":
22+
main()

0 commit comments

Comments
 (0)