Skip to content

Commit f01b3d2

Browse files
committed
Add comments in example.py
Signed-off-by: Patrick ZAJDA <[email protected]>
1 parent d470e19 commit f01b3d2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

example.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,22 @@ async def main():
1313
sms = Client(session, "https://api.smsbox.pro", API_KEY)
1414

1515
try:
16+
# To send a message
17+
# we define the strategy in the dict passed as last parameter
18+
# In this dict, we also ask the API to return the ID of message sent
19+
# With the parameter id set to 1
20+
# If we don't set id, the send function will return 0
21+
# In case of failure an exception will be thrown
22+
# It is commented, delete the # character and the following space on each line to uncomment it
1623
# msgID = await sms.send(
1724
# SMS_RECIPIENT, "Test message.", "expert", {"strategy": "2", "id": "1"}
1825
# )
26+
# We display the message is sent and its ID
1927
# print(f"SMS sent, ID : {msgID}")
28+
29+
# We get remaining credits
2030
credits = await sms.credits
31+
# print(f"Remaining credits: {credits}")
2132
if credits > 0:
2233
print("There are remaining credits")
2334
else:

0 commit comments

Comments
 (0)