1717
1818
1919def sendwhatmsg_instantly (
20- phone_no : str ,
21- message : str ,
22- wait_time : int = 15 ,
23- tab_close : bool = False ,
24- close_time : int = 3 ,
20+ phone_no : str ,
21+ message : str ,
22+ wait_time : int = 15 ,
23+ tab_close : bool = False ,
24+ close_time : int = 3 ,
2525) -> None :
2626 """Send WhatsApp Message Instantly"""
2727
@@ -42,12 +42,13 @@ def sendwhatmsg_instantly(
4242 if tab_close :
4343 core .close_tab (wait_time = close_time )
4444
45- def sendwhatimg_immediately (
46- phone_no : str ,
47- path : str ,
48- wait_time : int = 15 ,
49- tab_close : bool = False ,
50- close_time : int = 3 ,
45+
46+ def sendimg_or_video_immediately (
47+ phone_no : str ,
48+ path : str ,
49+ wait_time : int = 15 ,
50+ tab_close : bool = False ,
51+ close_time : int = 3 ,
5152) -> None :
5253 """Send WhatsApp Message Instantly"""
5354
@@ -59,13 +60,11 @@ def sendwhatimg_immediately(
5960 raise exceptions .InvalidPhoneNumber ("Invalid Phone Number." )
6061
6162 web .open (f"https://web.whatsapp.com/send?phone={ phone_no } " )
62- time .sleep (4 )
63- time .sleep (wait_time - 4 )
64- (ps_x , ps_y ) = pg .size ()
65- as_x = ps_x / 1920
66- as_y = ps_y / 1080
67- pg .click (671 * as_x , 964 * as_y )
68- pg .click (675 * as_x , 878 * as_y )
63+ time .sleep (wait_time )
64+ core .find_link ()
65+ time .sleep (1 )
66+ core .find_photo_or_video ()
67+
6968 pyperclip .copy (os .path .abspath (path ))
7069 print ("Copied" )
7170 time .sleep (1 )
@@ -81,12 +80,13 @@ def sendwhatimg_immediately(
8180 keyboard .release ("enter" )
8281 if tab_close :
8382 core .close_tab (wait_time = close_time )
83+
8484def sendwhatdoc_immediately (
85- phone_no : str ,
86- path : str ,
87- wait_time : int = 15 ,
88- tab_close : bool = False ,
89- close_time : int = 3 ,
85+ phone_no : str ,
86+ path : str ,
87+ wait_time : int = 15 ,
88+ tab_close : bool = True ,
89+ close_time : int = 3 ,
9090) -> None :
9191 """Send WhatsApp Message Instantly"""
9292
@@ -98,13 +98,10 @@ def sendwhatdoc_immediately(
9898 raise exceptions .InvalidPhoneNumber ("Invalid Phone Number." )
9999
100100 web .open (f"https://web.whatsapp.com/send?phone={ phone_no } " )
101- time .sleep (4 )
102- time .sleep (wait_time - 4 )
103- (ps_x , ps_y ) = pg .size ()
104- as_x = ps_x / 1920
105- as_y = ps_y / 1080
106- pg .click (671 * as_x , 964 * as_y )
107- pg .click (677 * as_x , 625 * as_y )
101+ time .sleep (wait_time )
102+ core .find_link ()
103+ time .sleep (1 )
104+ core .find_document ()
108105 pyperclip .copy (os .path .abspath (path ))
109106 print ("Copied" )
110107 time .sleep (1 )
@@ -121,14 +118,15 @@ def sendwhatdoc_immediately(
121118 if tab_close :
122119 core .close_tab (wait_time = close_time )
123120
121+
124122def sendwhatmsg (
125- phone_no : str ,
126- message : str ,
127- time_hour : int ,
128- time_min : int ,
129- wait_time : int = 15 ,
130- tab_close : bool = False ,
131- close_time : int = 3 ,
123+ phone_no : str ,
124+ message : str ,
125+ time_hour : int ,
126+ time_min : int ,
127+ wait_time : int = 15 ,
128+ tab_close : bool = False ,
129+ close_time : int = 3 ,
132130) -> None :
133131 """Send a WhatsApp Message at a Certain Time"""
134132 if not core .check_number (number = phone_no ):
@@ -166,13 +164,13 @@ def sendwhatmsg(
166164
167165
168166def sendwhatmsg_to_group (
169- group_id : str ,
170- message : str ,
171- time_hour : int ,
172- time_min : int ,
173- wait_time : int = 15 ,
174- tab_close : bool = False ,
175- close_time : int = 3 ,
167+ group_id : str ,
168+ message : str ,
169+ time_hour : int ,
170+ time_min : int ,
171+ wait_time : int = 15 ,
172+ tab_close : bool = False ,
173+ close_time : int = 3 ,
176174) -> None :
177175 """Send WhatsApp Message to a Group at a Certain Time"""
178176
@@ -204,11 +202,11 @@ def sendwhatmsg_to_group(
204202
205203
206204def sendwhatmsg_to_group_instantly (
207- group_id : str ,
208- message : str ,
209- wait_time : int = 15 ,
210- tab_close : bool = False ,
211- close_time : int = 3 ,
205+ group_id : str ,
206+ message : str ,
207+ wait_time : int = 15 ,
208+ tab_close : bool = False ,
209+ close_time : int = 3 ,
212210) -> None :
213211 """Send WhatsApp Message to a Group Instantly"""
214212
@@ -221,13 +219,13 @@ def sendwhatmsg_to_group_instantly(
221219
222220
223221def sendwhatsmsg_to_all (
224- phone_nos : List [str ],
225- message : str ,
226- time_hour : int ,
227- time_min : int ,
228- wait_time : int = 15 ,
229- tab_close : bool = False ,
230- close_time : int = 3 ,
222+ phone_nos : List [str ],
223+ message : str ,
224+ time_hour : int ,
225+ time_min : int ,
226+ wait_time : int = 15 ,
227+ tab_close : bool = False ,
228+ close_time : int = 3 ,
231229):
232230 for phone_no in phone_nos :
233231 sendwhatmsg (
@@ -236,14 +234,14 @@ def sendwhatsmsg_to_all(
236234
237235
238236def sendwhats_image (
239- receiver : str ,
240- img_path : str ,
241- time_hour : int ,
242- time_min : int ,
243- caption : str = "" ,
244- wait_time : int = 15 ,
245- tab_close : bool = False ,
246- close_time : int = 3 ,
237+ receiver : str ,
238+ img_path : str ,
239+ time_hour : int ,
240+ time_min : int ,
241+ caption : str = "" ,
242+ wait_time : int = 15 ,
243+ tab_close : bool = False ,
244+ close_time : int = 3 ,
247245) -> None :
248246 """Send Image to a WhatsApp Contact or Group at a Certain Time"""
249247
0 commit comments