tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

Get emoji names from searchEmojis #2727

Closed the-blank-x closed 8 months ago

the-blank-x commented 10 months ago

searchEmojis returns a td_api::emojis class, but the class only has a list of emojis, not emojis and their names. searchEmojis is used by Telegram X, but since TDLib doesn't return any names, Telegram X cannot show any corresponding names when listing emojis.

levlam commented 10 months ago

Emoji has no "names". Whatever you call their name, this is fixed and is not related to actual search.

the-blank-x commented 10 months ago

Whatever you call their name, this is fixed and is not related to actual search.

What do you mean?

levlam commented 10 months ago

I mean that emoji has no "names".

the-blank-x commented 10 months ago

By names, I was referring to the "keywords" of an emoji. For example, 🛞 is mapped to tire, tyre, and wheel. If I were searching for "t", I'd like to get tire and/or tire and tyre.

levlam commented 10 months ago

searchEmojis works in the opposite direction. There are no keywords mapped to an emoji, but list of emoji mapped to a keyword. An emoji can be found by hundreds of words in each language. The list of words can be very big and isn't supposed to be visible to the user unless the user typed the exact keyword.

the-blank-x commented 10 months ago

There are no keywords mapped to an emoji, but list of emoji mapped to a keyword.

Isn't that what I said?

levlam commented 10 months ago

No. You can receive multiple emoji by a keyword. The keyword is just a search term in searchEmojis, it isn't supposed to be visible to the user.

the-blank-x commented 10 months ago

Multiple emojis sharing the same keyword isn't (or at least shouldn't) be a problem though

the-blank-x commented 8 months ago

Thank you! (For anyone else looking, this issue was fixed by https://github.com/tdlib/td/commit/bf6345248fd6e9310eb54306af5700eedebe7386)