Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Bug with emoji encoding? #396
Comments
|
After debugging into pyrogram i found that I actually don't need indexing to insert links, I can use pyrogram/pyrogram/client/types/messages_and_media/message.py Lines 606 to 610 in 88e42ec Before this statement the pyrogram/pyrogram/client/types/messages_and_media/message.py Lines 57 to 58 in 88e42ec but I didn't debug it further. That explains why it works with iterating over I don't know why |
Hi, when I get text from telegram message that contains emoji, I can't index the message string properly. Here's sample code:
Output is:
I use emoji package for generating emojis, but the same error is thrown when pyrogram gets message sent directly from telegram app.
Is it a bug in the encoding of the message text? Am I doing something wrong?
I need to index the characters because I'm inserting the Message.entities as markdown links, so I can send the original links along with the updated message.
I know I can manually convert it using
old_text = str(msg.text)(and then indexing works) but thenmsg.entitiesoffsets are wrong.Thank you in advance for any help.
I use: