v1 one doesn't recognise the MessageEntityMentionName delimiters and it recognise them as MessageEntityTextUrl
Читать полностью…i haven't read the entire conversation so i don't know what you're trying to achieve
Читать полностью…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
Too many tries haha, will try in a while :) But thanks for the tip, I'll let you know
Читать полностью…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?
Читать полностью…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
Читать полностью…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?
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
Читать полностью…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 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
Читать полностью…It seems CHARGE_ALREADY_REFUNDED
is missing:
telethon.errors.rpcbaseerrors.BadRequestError: RPCError 400: CHARGE_ALREADY_REFUNDED (caused by RefundStarsChargeRequest)
Could you add it?
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
Читать полностью…