-
Notifications
You must be signed in to change notification settings - Fork 2
/
message_functions.py
56 lines (29 loc) · 1.29 KB
/
message_functions.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import requests
import pywhatkit
import datetime
from datetime import timedelta
def casper_alert(bot_alert):
bot_token = "5679912803:AAFNf9EHAxJnqpTmzHBr0ZuaeqeLtFx1oc8"
my_chatID = "1813981055"
send_alert = "https://api.telegram.org/bot" + bot_token + "/sendMessage?chat_id=" + my_chatID + "&parse_mode=Markdown&text=" + "*" + bot_alert + "*"
response = requests.get(send_alert)
return response.json()
def telegram_text(send):
bot_token = "5679912803:AAFNf9EHAxJnqpTmzHBr0ZuaeqeLtFx1oc8"
my_chatID = "1813981055"
send_text = "https://api.telegram.org/bot" + bot_token + "/sendMessage?chat_id=" + my_chatID + "&parse_mode=Markdown&text=" + send
response = requests.get(send_text)
return response.json()
def whatsapp_text(send):
hour = int(datetime.datetime.now().strftime("%H"))
print(hour)
now_m = datetime.datetime.now().strftime("%M")
dt = datetime.datetime.now().strptime(now_m, "%M")
add_m = str(dt + timedelta(minutes=1))
a = add_m.replace("1900-01-01 ", "")
b = a.replace(":00", "")
min = b.replace("00:", "")
print(min)
min = int(min)
pywhatkit.sendwhatmsg("+94741040292", send, hour, min)
# https://web.whatsapp.com/send?phone=+94741040292&text=this%20is%20a%20test