forked from ar-nadeem/WhatsApp-Selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLinuxRun.py
More file actions
39 lines (21 loc) · 827 Bytes
/
LinuxRun.py
File metadata and controls
39 lines (21 loc) · 827 Bytes
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
import re
from Whatsapp import Whatsapp
import random
import asyncio
jbh = ["Ach.", "Ok sir.","JBH +1"]
bawa = ["Is someone talking about bawa ? Bawa is king !"]
bott = ["Hi from bot"]
bot = Whatsapp(silent=True, headless=True)#,executable_path="/var/lib/flatpak/exports/bin/org.chromium.Chromium")
async def func(element, msg):
if (re.search("^jbh$|^jbh\.$", msg[2].lower())):
print(msg)
bot.replyTo(element, jbh[random.randrange(len(jbh))])
if (re.search("^.*bawa.*$", msg[2].lower())):
print(msg)
bot.replyTo(element, bawa[random.randrange(len(bawa))])
if (re.search("^.*bot.*$", msg[2].lower())):
print(msg)
bot.replyTo(element, bott[random.randrange(len(bott))])
bot.login()
print("Reading messages now !")
bot.hookIncomming("Sequence ", func)