-
Notifications
You must be signed in to change notification settings - Fork 10
/
main.py
34 lines (29 loc) · 881 Bytes
/
main.py
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
34
import requests, click
class SMS:
def __init__(self, number, text):
self.number = number
self.text = text
self.url = "https://textbelt.com/text"
self.data = {"phone": number, "message": text, "key": "textbelt"}
def sendSMS(self):
res = requests.post(self.url, data=self.data).json()
if res['success']:
click.secho("[+] Sent Message Successfully!", fg="green")
else:
click.secho("[-] Couldn't Send Message!", fg="red")
click.secho('[-] '+res['error'], fg="red")
def main():
try:
NUMBER = click.prompt('Enter Number (Include country code, e.g. +92)', type=str)
TEXT = str(input("Enter Message: "))
except:
click.secho("\n[-] Good bye!", fg="red")
exit(0)
sms = SMS(NUMBER, TEXT)
if click.confirm('Do you want to send the message?'):
sms.sendSMS()
else:
click.secho("[-] Good bye!", fg="red")
exit(0)
if __name__ == '__main__':
main()