It's not an error. make new client instance if it fails and start it cleanly
as for why it disconnects, you'll have to ask that to Telegram or it's complication by your software and python
nothing built-in. you have to implement polling yourself with GetChannelDifference
Читать полностью…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.
If the answer is yes, are we able to handle updates of a large number of public chats this way?
Читать полностью…/channel/TelethonChat/618825
types.InputInvoiceStarGiftUpgrade
functions.payments.GetPaymentFormRequest
functions.payments.SendStarsFormRequest
new error is coming
ERROR:telethon.network.mtprotosender:Automatic reconnection failed 0 time(s)
Could not find the input entity for PeerUser(user_id=1154431484) (PeerUser). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.
Читать полностью…it's a you problem, don't use many sessions, reconnects and freezes can lead to sync issues
edit the library or patch the client._sender._state.id and disable reconnects
Hey, I am facing this error since 1 month, tried to solve but no success
telethon.network.mtprotosender - WARNING - Security error while unpacking a received message: Server replied with a wrong session ID (see FAQ for details)
which part of "channel_post_id'' made you think it wants a "discussion channel" message id?
Читать полностью…hey! can someone pls help with fetching the comments for a post from a main channel. because the code that is in this channel
async for comment in client.iter_messages(channel, reply_to=channel_post_id):
if comment.sender_id == ...:
await comment.reply(...)
break
post_message = await client.get_messages(channel_username, ids=message.id)Читать полностью…
if post_message.can_get_message_thread:
thread = await client.get_message_thread(channel_username, message_id=post_message.id)
comments = await client.get_messages(thread, limit=100)
Hello, can you tell me if you can add a bot to a video call in a group rather than a bot user?
Читать полностью…invoice = InputInvoiceStarGift(user_id=user_id, gift_id=gift.id)
form_info = await client(functions.payments.GetPaymentFormRequest(invoice=invoice))
An error occurred: a TLObject was expected but found something elseЧитать полностью…
Error type: <class 'TypeError'>
Traceback (most recent call last):
File "/usr/local/lib/python3.11/dist-packages/telethon/tl/tlobject.py", line 194, in __bytes__
return self._bytes()
^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/tl/functions/payments.py", line 625, in _bytes
self.invoice._bytes(),
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/tl/types/__init__.py", line 13778, in _bytes
self.user_id._bytes(),
^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute '_bytes'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/gifts/bot.py", line 42, in buy_gift
form_info = await client(functions.payments.GetPaymentFormRequest(invoice=invoice))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/client/users.py", line 30, in __call__
return await self._call(self._sender, request, ordered=ordered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/client/users.py", line 67, in _call
future = sender.send(request, ordered=ordered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/network/mtprotosender.py", line 183, in send
state = RequestState(request)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/network/requeststate.py", line 17, in __init__
self.data = bytes(request)
^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/telethon/tl/tlobject.py", line 200, in __bytes__
raise TypeError('a TLObject was expected but found something else')
TypeError: a TLObject was expected but found something else