yowsup icon indicating copy to clipboard operation
yowsup copied to clipboard

Send emoji through yowsup-cli

Open Pedro-H-Fialho opened this issue 11 years ago • 11 comments

How am I supposed to use the Emotions unicode when sending a message

I took the unicode from http://apps.timwhitlock.info/emoji/tables/unicode

And tried yowsup-cli demos -l phobe:b64pass -s phone UNICODE

But I receive it in plain text.

Thanks in advance.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Pedro-H-Fialho avatar Jan 10 '15 04:01 Pedro-H-Fialho

Please use SoftBank codes from this page : code.iamcal.com/php/emoji/

kuldippatel avatar Jan 11 '15 07:01 kuldippatel

@kuldippatel Did you try out what you just suggested? It doesnt work

Ipystar avatar Jan 11 '15 13:01 Ipystar

At the moment yowsup-cli is not meant to be used for sending emoji. But I'll leave this issue open as a reference in case it gets implemented, I've updated the issue title as well

tgalal avatar Jan 11 '15 15:01 tgalal

I had used it in legacy code.

Sample code.

finalMsg= msg+ u'\ue058'

kuldippatel avatar Jan 11 '15 15:01 kuldippatel

@kuldippatel yes it should work fine from code, sending from command line using yowsup-cli is a diff thing in this scenario

tgalal avatar Jan 11 '15 15:01 tgalal

just add two commands in cli: "/:)" - semd smile emoji "/:(" - send sad emoji or so :D

CODeRUS avatar Jan 11 '15 16:01 CODeRUS

You could replace some stuff code side but that wont be a general solution to the Problem. You can add some Emojis but not every single one... Well you could but you get the point. I did something like that to be able to send NewLine by replacing all "###" with "\n"

dedmen avatar Jan 12 '15 13:01 dedmen

Hey, it is not working from the code. Can somebody share a sample snippet? I am getting an exception.

kuldippatel avatar Feb 05 '15 06:02 kuldippatel

@tgalal Sorry Tarek for duplication. Thanks for closing it.

kuldippatel avatar Feb 05 '15 06:02 kuldippatel

~~I am unable to send smileys, I get the error;~~

File "/Users/sbot/Documents/projects/Sbot/yowsup/structs/protocoltreenode.py", line 69, in toString
    out += "\nHEX:%s\n" % binascii.hexlify(self.data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\ue058' in position 16: ordinal not in range(128)

while trying to send text_msg = u"*slow clap* ... \ue058" I tried to use text_msg = "*slow clap* ... \ue058" but it sends the literal text not the emoticon. ~~Anyone know how?~~


Edit: I forgot to encode the message to text_msg = u"*slow clap* ... \ue058".encode('utf-8') This sends the message however text_msg = u"*slow clap* ... \ue058" doesnt so beware.

tested under python 2.7.6 and 2.7.9

sinanm89 avatar Sep 01 '15 16:09 sinanm89

you have to encode it, like so:

text_msg = "slow clap ... \ue058".encode("utf-8")

-------- Original Message -------- From:Sinan Midillili [email protected] Sent:Tue, 01 Sep 2015 13:38:50 -0300 To:tgalal/yowsup [email protected] Subject:Re: [yowsup] Send emoji through yowsup-cli (#529)

I am unable to send smileys, I get the error;

File "/Users/sbot/Documents/projects/Sbot/yowsup/structs/protocoltreenode.py", line 69, in toString out += "\nHEX:%s\n" % binascii.hexlify(self.data) UnicodeEncodeError: 'ascii' codec can't encode character u'\ue058' in position 16: ordinal not in range(128)

while trying to send text_msg = u"slow clap ... \ue058" I tried to use text_msg = "slow clap ... \ue058" but it sends the literal text not the emoticon. Anyone know how?

— Reply to this email directly or view it on GitHub.

Dl0tt avatar Sep 02 '15 17:09 Dl0tt