Python pywhatkit emoticon

1.2k Views Asked by At

I'm using pywhatkit library for sending message to whatsapp, and it works fine, but I need to send emoticon and the text splitted in more line.

Is possible to send new line and emoticon?

I've tried with the following code:

msg = 'text :-) \n new line :-)'
pywhatkit.sendwhatmsg_instantly(NUMBER, str(msg) , 5, False, 5)

but it not works, and I received the exactly string (not emoticon and new line) that I've worte

Thanks a lot

2

There are 2 best solutions below

7
Prakhar Gupta On

You can write msg variable like this to send the message in next line And to get the emoticons you can use hex codes like this: \U0001F600 (Reference: Emoticon) -

msg = '''text \U0001F600 \n 

new line

\U0001F600 '''
0
Giulio On

This is my full code:

msg = str(self.config.get_value_from_conf('message'))
print(type(msg))
msg = str(re.sub('@@@', name, msg))
pywhatkit.sendwhatmsg_instantly(str(number), str(msg) , 5, False, 5)

print type is:

<class 'str'>