telethonchat | Unsorted

Telegram-канал telethonchat - Telethon Chat

6097

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

Subscribe to a channel

Telethon Chat

v1 one doesn't recognise the MessageEntityMentionName delimiters and it recognise them as MessageEntityTextUrl

Читать полностью…

Telethon Chat

i haven't read the entire conversation so i don't know what you're trying to achieve

Читать полностью…

Telethon Chat

v2 is not ready to be used

Читать полностью…

Telethon Chat

Huh I think I gotta use v2 codes in my code, yeah?

Читать полностью…

Telethon Chat

async def _replace_with_mention(self: 'TelegramClient', entities, i, user):
"""
Helper method to replace ``entities[i]`` to mention ``user``,
or do nothing if it can't be found.
"""
try:
entities[i] = types.InputMessageEntityMentionName(
entities[i].offset, entities[i].length,
await self.get_input_entity(user)
)
return True
except (ValueError, TypeError):
return False

Читать полностью…

Telethon Chat

And it doesn't happen in v2 send message function.

Читать полностью…

Telethon Chat

and how do I get the date of birth from the user's profile?

Читать полностью…

Telethon Chat

Majnoon : 7218810690

Читать полностью…

Telethon Chat

Too many tries haha, will try in a while :) But thanks for the tip, I'll let you know

Читать полностью…

Telethon Chat

Tried, same thing :(

Читать полностью…

Telethon Chat

Hi, I just got a new phone number and I'd like to test an app. when I create the app on my telegram org I get an error. Any idea if it's due to the new number, if there's a cooldown?

Читать полностью…

Telethon Chat

Hey, how can we track members and members online count?

Читать полностью…

Telethon Chat

How write in a Channel with Telethon library ?

Читать полностью…

Telethon Chat

the _disconnect future should be being set with the error, and _run_until_disconnected should be awaiting that same future to propagate the error upwards when it happens

Читать полностью…

Telethon Chat

If I wanted to get the peer id using the username, I would use await client.get_peer_id
If I wanted to convert the id to peer id, I would use utils.get_peer_id

Did I understand correctly?

Читать полностью…

Telethon Chat

though the wiki explains how to modify v1 parsers for custom entities

Читать полностью…

Telethon Chat

☔️☔️☔️☔️

Читать полностью…

Telethon Chat

Isn't there any other way better?

Читать полностью…

Telethon Chat

There's something like this in v2

Читать полностью…

Telethon Chat

Huh lemme compare v1 and v2 codes

Читать полностью…

Telethon Chat

I used to parse the unparsed text and extract entities of it, but that recognise [SomeName](tg://user?id=someid) as an MessageEntityTextUrl , not an MessageEntityMentionName

Читать полностью…

Telethon Chat

Use MessageEntityTextUrl instead..

Читать полностью…

Telethon Chat

message, entities = client.parse_mode.parse(message)
This was the way that divides entities and raw_text from an unparsed text after parsing, And I used that with

await client(InvokeWithBusinessConnectionRequest(connection_id,SendMessageRequest(peer=chat_id,message=message,no_webpage=True,entities=entities,reply_to=reply_to,**kwargs,)))

as examples
But in results, I defined that hyperlinks with tg://user?id=12345678 won't be parsed to a NameUserMention and it will be parsed like a simple hyperlink

Читать полностью…

Telethon Chat

Disable vpn/or any kind of DNS and then login and try to create application

Читать полностью…

Telethon Chat

iirc you should put some url in, for example google

Читать полностью…

Telethon Chat

Documentation for get_permissions

Читать полностью…

Telethon Chat

How did you get the channel privilege list?

Читать полностью…

Telethon Chat

as terrible as it is i suggest you match on the error string because i don't know when/if i'll add it, and after that when/if i'll make a release

Читать полностью…

Telethon Chat

It seems CHARGE_ALREADY_REFUNDED is missing:
telethon.errors.rpcbaseerrors.BadRequestError: RPCError 400: CHARGE_ALREADY_REFUNDED (caused by RefundStarsChargeRequest)

Could you add it?

Читать полностью…

Telethon Chat

if it's a 404, autoreconnect should not occur, because the session is completely dead. the error must be propagated upwards for the users to handle

Читать полностью…
Subscribe to a channel