Add emoticons in tweet text updated using tweepy

Question:

I am creating an auto-DM bot using tweepy. I want to add emojis to the text. Is it possible? I have tried adding ' '
and :heartpulse::heart_eyes_cat: without luck.

Asked By: usama aslam

||

Answers:

Adding :heartpulse::heart_eyes_cat: like this doesn’t help.

Since emoticons are just special characters, all you have to do is use the right encoding to add them in the text. All you need to display is the font that support them.

U+1F601 is 16 bit unicode. In this U+1F601 is unicode representation of emoticon character.

enter image description here

For more info on the unicode and utf representation of emoticons refer to the following link.
https://apps.timwhitlock.info/emoji/tables/unicode

Answered By: kartheek

actually, a much simple thing is to just add the emoji to the text like this:

tweet_test = 'this is emoji  '
api.update_status(status=tweet)
Answered By: wasif

To complement @kharteek answer to use the Unicode code points to add the emojis to the text, for example is U+1F680 according to unicode.org.
So in python3 you can do something like:

rocket = 'U0001F680'
print(rocket)

Hope it helps.

Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.