Skip to content

Commit c6d86e2

Browse files
authored
Add function to send group message instantly
1 parent 468585e commit c6d86e2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pywhatkit/whats.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
117135
def sendwhats_image(
118136
receiver: str,
119137
img_path: str,

0 commit comments

Comments
 (0)