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
@@ -64,8 +65,10 @@ def sendwhatimg_immediately(
6465 (ps_x , ps_y ) = pg .size ()
6566 as_x = ps_x / 1920
6667 as_y = ps_y / 1080
67- pg .click (671 * as_x , 964 * as_y )
68- pg .click (675 * as_x , 878 * as_y )
68+ core .find_link ()
69+ time .sleep (1 )
70+ core .find_photo_or_video ()
71+
6972 pyperclip .copy (os .path .abspath (path ))
7073 print ("Copied" )
7174 time .sleep (1 )
@@ -81,12 +84,13 @@ def sendwhatimg_immediately(
8184 keyboard .release ("enter" )
8285 if tab_close :
8386 core .close_tab (wait_time = close_time )
87+
8488def sendwhatdoc_immediately (
85- phone_no : str ,
86- path : str ,
87- wait_time : int = 15 ,
88- tab_close : bool = False ,
89- close_time : int = 3 ,
89+ phone_no : str ,
90+ path : str ,
91+ wait_time : int = 15 ,
92+ tab_close : bool = True ,
93+ close_time : int = 3 ,
9094) -> None :
9195 """Send WhatsApp Message Instantly"""
9296
@@ -103,8 +107,9 @@ def sendwhatdoc_immediately(
103107 (ps_x , ps_y ) = pg .size ()
104108 as_x = ps_x / 1920
105109 as_y = ps_y / 1080
106- pg .click (671 * as_x , 964 * as_y )
107- pg .click (677 * as_x , 625 * as_y )
110+ core .find_link ()
111+ time .sleep (1 )
112+ core .find_document ()
108113 pyperclip .copy (os .path .abspath (path ))
109114 print ("Copied" )
110115 time .sleep (1 )
@@ -121,14 +126,15 @@ def sendwhatdoc_immediately(
121126 if tab_close :
122127 core .close_tab (wait_time = close_time )
123128
129+
124130def 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 ,
131+ phone_no : str ,
132+ message : str ,
133+ time_hour : int ,
134+ time_min : int ,
135+ wait_time : int = 15 ,
136+ tab_close : bool = False ,
137+ close_time : int = 3 ,
132138) -> None :
133139 """Send a WhatsApp Message at a Certain Time"""
134140 if not core .check_number (number = phone_no ):
@@ -166,13 +172,13 @@ def sendwhatmsg(
166172
167173
168174def 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 ,
175+ group_id : str ,
176+ message : str ,
177+ time_hour : int ,
178+ time_min : int ,
179+ wait_time : int = 15 ,
180+ tab_close : bool = False ,
181+ close_time : int = 3 ,
176182) -> None :
177183 """Send WhatsApp Message to a Group at a Certain Time"""
178184
@@ -204,11 +210,11 @@ def sendwhatmsg_to_group(
204210
205211
206212def 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 ,
213+ group_id : str ,
214+ message : str ,
215+ wait_time : int = 15 ,
216+ tab_close : bool = False ,
217+ close_time : int = 3 ,
212218) -> None :
213219 """Send WhatsApp Message to a Group Instantly"""
214220
@@ -221,13 +227,13 @@ def sendwhatmsg_to_group_instantly(
221227
222228
223229def 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 ,
230+ phone_nos : List [str ],
231+ message : str ,
232+ time_hour : int ,
233+ time_min : int ,
234+ wait_time : int = 15 ,
235+ tab_close : bool = False ,
236+ close_time : int = 3 ,
231237):
232238 for phone_no in phone_nos :
233239 sendwhatmsg (
@@ -236,14 +242,14 @@ def sendwhatsmsg_to_all(
236242
237243
238244def 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 ,
245+ receiver : str ,
246+ img_path : str ,
247+ time_hour : int ,
248+ time_min : int ,
249+ caption : str = "" ,
250+ wait_time : int = 15 ,
251+ tab_close : bool = False ,
252+ close_time : int = 3 ,
247253) -> None :
248254 """Send Image to a WhatsApp Contact or Group at a Certain Time"""
249255
0 commit comments