File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ pywhatkit.sendwhats_image("+910123456789", "Images/Hello.png")
6868# Send a WhatsApp Message to a Group at 12:00 AM
6969pywhatkit.sendwhatmsg_to_group(" AB123CDEFGHijklmn" , " Hey All!" , 0 , 0 )
7070
71+ # Send a WhatsApp Message to a Group instantly
72+ pywhatkit.sendwhatmsg_to_group_instantly(" AB123CDEFGHijklmn" , " Hey All!" )
73+
7174# Play a Video on YouTube
7275pywhatkit.playonyt(" PyWhatKit" )
7376```
Original file line number Diff line number Diff line change @@ -114,6 +114,24 @@ def sendwhatmsg_to_group(
114114 core .close_tab (wait_time = close_time )
115115
116116
117+ def sendwhatmsg_to_group_instantly (
118+ group_id : str ,
119+ message : str ,
120+ wait_time : int = 15 ,
121+ tab_close : bool = False ,
122+ close_time : int = 3 ,
123+ ) -> None :
124+ """Send WhatsApp Message to a Group Instantly"""
125+
126+ current_time = time .localtime ()
127+
128+ time .sleep (sleep_time )
129+ core .send_message (message = message , receiver = group_id , wait_time = wait_time )
130+ log .log_message (_time = current_time , receiver = group_id , message = message )
131+ if tab_close :
132+ core .close_tab (wait_time = close_time )
133+
134+
117135def sendwhats_image (
118136 receiver : str ,
119137 img_path : str ,
You can’t perform that action at this time.
0 commit comments