-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfunctionality.py
47 lines (30 loc) · 972 Bytes
/
functionality.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
import pandas as pd
from scrapper import *
class broadcast_functionality() :
#//TODO : CREATES CLASS DOCSTRING
def sent_messages_without_attachment(self,message,path) :
#//TODO :
user_name = pd.read_excel(path,engine='openpyxl')
user_name = [str(x) for x in user_name['RECIPIENT']]
wa_bot = wa_web()
wa_bot.get_url()
time.sleep(20)
for user in user_name :
try :
wa_bot.msg_only(user,message)
except InvalidArgumentException :
print(f'{user} does not exists')
continue
def sent_messages_with_attachment(self,message,path,att_path) :
user_name = pd.read_excel(path,engine='openpyxl')
user_name = [str(x) for x in user_name['RECIPIENT']]
wa_bot = wa_web()
wa_bot.get_url()
time.sleep(20)
for user in user_name :
try :
file_location = att_path
wa_bot.msg_document(user,message,file_location)
except InvalidArgumentException :
continue
print(f'{user} does not exists')