MCPcopy Create free account
hub / github.com/geekcomputers/Python / main

Function main

whatsapp-schedule.py:21–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20
21def main():
22 msg_type = int(input("Enter 1 to send a message to a uSER and 2 to a GROUP: "))
23 if msg_type == 1:
24 phone = input("Enter phone number: ")
25 if phone[0] == "0":
26 phone = phone[1::]
27 while True:
28 if len(phone) < 9:
29 raise ValueError("Invalid phone number: ")
30 else:
31 break
32 phone = f"+233{phone}"
33 elif msg_type == 2:
34 group = input("Enter group to send message: ")
35 msg = str(input("Enter message: "))
36 hour = int(input("Enter the time in hour: "))
37 minute = int(input("Enter the time in minute: "))
38
39 if msg_type == 1:
40 send_msg(phone, msg, hour, minute)
41 elif msg_type == 2:
42 send_whatmsg_to_group(group, msg, hour, minute)
43
44
45if __name__ == "__main__":

Callers 1

Calls 2

send_msgFunction · 0.85
send_whatmsg_to_groupFunction · 0.85

Tested by

no test coverage detected