简体   繁体   English

在使用 tweepy 更新的推文文本中添加表情符号

[英]Add emoticons in tweet text updated using tweepy

I am creating an auto-DM bot using tweepy.我正在使用 tweepy 创建一个自动 DM 机器人。 I want to add emojis to the text.我想在文本中添加表情符号。 Is it possible?是否可以? I have tried adding '😻💗' and :heartpulse::heart_eyes_cat: without luck.我试过添加'😻💗':heartpulse::heart_eyes_cat:没有运气。

Adding :heartpulse::heart_eyes_cat: like this doesn't help. 添加:heartpulse :: heart_eyes_cat:这样没有帮助。

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. U + 1F601是16位Unicode。 In this U+1F601 is unicode representation of emoticon character. 在此U + 1F601中是表情符号字符的unicode表示。

在此处输入图片说明

For more info on the unicode and utf representation of emoticons refer to the following link. 有关表情符号的unicode和utf表示的更多信息,请参考以下链接。 https://apps.timwhitlock.info/emoji/tables/unicode https://apps.timwhitlock.info/emoji/tables/unicode

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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM