6095
Official Telethon's chat! Rules: • Speak English • Stay on topic (questions about Telethon) • Be respectful • Don't ask to ask • Spam-related uses lead to ban • Read https://docs.telethon.dev before asking things here Read more about us @TelethonUpdates
Ahh yeh i didn't mean rude
But look at his messages
Yeah, TDesktop actually strips \uFE0F client-side before firing the request. Telethon is just a raw MTProto wrapper so it doesn't sanitize anything for you. You just have to strip it manually.
Читать полностью…
import asyncioЧитать полностью…
from telethon import TelegramClient
from telethon.tl import functions, types
api_id = ''
api_hash = ''
client = TelegramClient('reaction', api_id, api_hash)
async def main():
await client.start()
target = '@'
msg_id = 4507
reaction = '❤️'
try:
cleaan = reaction.replace('\ufe0f', '').replace('\uFE0F', '')
entity = await client.get_input_entity(target)
await client(functions.messages.SendReactionRequest(
peer=entity,
msg_id=msg_id,
big=True,
add_to_recent=True,
reaction=[types.ReactionEmoji(emoticon=cleaan)]
))
print("done")
except Exception as e:
print(e)
if __name__ == '__main__':
client.loop.run_until_complete(main())
It's almost always the exact same character (\uFE0F). It's the universal Unicode variation selector that keyboards automatically add to force the colorful emoji style instead of plain text.
Just run .replace('\ufe0f', '') on all your emoji strings before passing them to the API. That single replace will fix the errors for the rest of the standard emojis too.
The red heart emoji "❤️" includes a hidden Unicode character (\uFE0F) that Telegram's API rejects. Just strip it out and wrap the reaction in a list using types.ReactionEmoji.
from telethon.tl import typesЧитать полностью…
cleaan = reaction.replace('\ufe0f', '').replace('\uFE0F', '')
await client(functions.messages.SendReactionRequest(
peer=peer,
msg_id=msg_id,
big=True,
add_to_recent=True,
reaction=[types.ReactionEmoji(emoticon=cleaan)]
))
Hi and welcome to the group. Before asking any questions, please read the rules from the group's description, and don't forget to read the docs. Make sure you are using the latest version with pip3 install -U telethon, since most problems have already been fixed in newer versions.
Hi
I have webapp bot
How can i download file in webapp?
Backend (FastApi - FileResponse)
When click it to download, nothing happend
Has this been updated and how do we do that in telethon?
For now I just use html rich input type constructor and pass the raw html directly :(
i haven't had it happen myself, so i don't know if the latter is enough. i would expect so
Читать полностью…
Ephemeral messages was needed actually, idk about rich messages tho
Читать полностью…
use the *Markdown or *HTML variant depending on your syntax.
Читать полностью…
See rich message formatting options and use the raw types available in Telethon.
Читать полностью…
If you look at data_message_reactions.cpp, it passes the emoji to Ui::Emoji::Find(). TDesktop actually sanitizes and strips that \uFE0F in its UI engine before ever making the API call. Since Telethon is just a raw API wrapper without a UI engine, it doesn't do that for you. You just have to strip it manually.
https://github.com/telegramdesktop/tdesktop/blob/master/Telegram/SourceFiles/data/data_message_reactions.cpp
is there a list of such hidden characters for other emojies or is it the same for all emojies? because likely I have this problem not only with heart emoji, a lot of such errors for other emojies, it's just that I verified only for heart emoji that it's 100% in available list
Читать полностью…
hello why might I be getting Invalid reaction provided (only emoji are allowed) (caused by SendReactionRequest) for following
await client(functions.messages.SendReactionRequest(
peer=peer, msg_id=msg_id, big=True, add_to_recent=True,
reaction=reaction,
))
Normal like in html
<a href="" download="">.,</a>
There's no hurry tho I'm not doing it anytime soon
Читать полностью…
Yeah, and im certain sure as you it can be from that
But myself in years, i haven’t seen the issue after layer update
tdesktop sometimes makes a commit of a layer that's not finished yet, so that's an option, yes
see diff.telethon.dev. it uses tdesktop. if you toggle the checkbox to view the same layer multiple times, you will see a lot of duplicates
For now it's new and probably a bit complex to get along with for now
Читать полностью…
Ofc they will be used, but usage percentage is what judges the feature need in platform
Читать полностью…