Skip to content

Commit 82ed1c4

Browse files
committed
def param host
1 parent 674e45d commit 82ed1c4

File tree

7 files changed

+9
-20
lines changed

7 files changed

+9
-20
lines changed

examples/createGroupAndSendMessage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
ID_INSTANCE = environ['ID_INSTANCE']
77
API_TOKEN_INSTANCE = environ['API_TOKEN_INSTANCE']
88

9-
restApi = greenAPI.RestApi('https://api.green-api.com',
10-
ID_INSTANCE,
11-
API_TOKEN_INSTANCE)
9+
restApi = greenAPI.RestApi(ID_INSTANCE, API_TOKEN_INSTANCE)
1210

1311
def main():
1412
chatIds = [

examples/receiveNotification.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
ID_INSTANCE = environ['ID_INSTANCE']
66
API_TOKEN_INSTANCE = environ['API_TOKEN_INSTANCE']
77

8-
restApi = greenAPI.RestApi('https://api.green-api.com',
9-
ID_INSTANCE,
10-
API_TOKEN_INSTANCE)
8+
restApi = greenAPI.RestApi(ID_INSTANCE, API_TOKEN_INSTANCE)
119

1210
def main():
1311
restApi.webhooks.startReceivingNotifications()

examples/sendPictureByLink.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
ID_INSTANCE = environ['ID_INSTANCE']
66
API_TOKEN_INSTANCE = environ['API_TOKEN_INSTANCE']
77

8-
restApi = greenAPI.RestApi('https://api.green-api.com',
9-
ID_INSTANCE,
10-
API_TOKEN_INSTANCE)
8+
restApi = greenAPI.RestApi(ID_INSTANCE, API_TOKEN_INSTANCE)
119

1210
def main():
1311
result = restApi.sending.sendFileByUrl('79001234567@c.us',

examples/sendPictureByUpload.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
ID_INSTANCE = environ['ID_INSTANCE']
66
API_TOKEN_INSTANCE = environ['API_TOKEN_INSTANCE']
77

8-
restApi = greenAPI.RestApi('https://api.green-api.com',
9-
ID_INSTANCE,
10-
API_TOKEN_INSTANCE)
8+
restApi = greenAPI.RestApi(ID_INSTANCE, API_TOKEN_INSTANCE)
119

1210
def main():
1311
result = restApi.sending.sendFileByUpload('79001234567@c.us',

examples/sendTextMessage.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
ID_INSTANCE = environ['ID_INSTANCE']
66
API_TOKEN_INSTANCE = environ['API_TOKEN_INSTANCE']
77

8-
restApi = greenAPI.RestApi('https://api.green-api.com',
9-
ID_INSTANCE,
10-
API_TOKEN_INSTANCE)
8+
restApi = greenAPI.RestApi(ID_INSTANCE, API_TOKEN_INSTANCE)
119

1210
def main():
1311
result = restApi.sending.sendMessage('79001234567@c.us', 'Message text')

tests/test_main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
ID_INSTANCE = environ['ID_INSTANCE']
77
API_TOKEN_INSTANCE = environ['API_TOKEN_INSTANCE']
88

9-
RestApi = greenAPI.RestApi('https://api.green-api.com',
10-
ID_INSTANCE,
11-
API_TOKEN_INSTANCE)
9+
RestApi = greenAPI.RestApi(ID_INSTANCE, API_TOKEN_INSTANCE)
1210

1311
class TestClass:
1412
def test_getSettings(self):

whatsapp_api_client_python/greenAPI.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ class RestApi:
2121
idInstance: str
2222
apiTokenInstance: str
2323

24-
def __init__(self, host: str,
24+
def __init__(self,
2525
idInstance: str,
26-
apiTokenInstance: str) -> None:
26+
apiTokenInstance: str,
27+
host: str = 'https://api.green-api.com') -> None:
2728
self.host = host
2829
self.idInstance = idInstance
2930
self.apiTokenInstance = apiTokenInstance

0 commit comments

Comments
 (0)