-
Notifications
You must be signed in to change notification settings - Fork 1
/
indexrun.py
34 lines (29 loc) · 1.22 KB
/
indexrun.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 whatsAppbot as whatsApp
from flask import Flask,render_template,request
app =Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
@app.route("/whatsApp",methods=["POST","GET"])
def sendWts():
if request.method=="POST":
try:
phoneNumber = request.form["phoneNumber"]
article = request.form["article"]
print(article)
if phoneNumber!= None and article != None:
if len(phoneNumber)>8:
phoneNumber=phoneNumber.replace(" ","")
if len(phoneNumber)==8:
whatsApp.webController(phoneNumber=phoneNumber,article=article)
else:
atr = phoneNumber.split(",")
for temp in atr:
print("temp :"+temp)
whatsApp.webController(phoneNumber=temp,article=article)
return render_template("200.html")
else:
return render_template("404.html")
except Exception as err :
print(err)
return render_template("404.html")