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.
async with is not async def...
and as i mentioned, just use get_messages() if you can't manage it, it will get you latest response by bot that should naturally reply to /start
What are you even doing, why did you remove the async with, just read the docs of it and implement it as it says
Читать полностью…Traceback (most recent call last):Читать полностью…
File "/usr/local/lib/python3.10/dist-packages/telethon/client/updates.py", line 570, in _dispatch_update
await callback(event)
File "/root/freedom/app.py", line 663, in new_message
response = await conv.get_response()
File "/usr/local/lib/python3.10/dist-packages/telethon/tl/custom/conversation.py", line 157, in get_response
return self._get_message(
File "/usr/local/lib/python3.10/dist-packages/telethon/tl/custom/conversation.py", line 230, in _get_message
return self._get_result(future, start_time, timeout, pending, target_id)
File "/usr/local/lib/python3.10/dist-packages/telethon/tl/custom/conversation.py", line 22, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/telethon/tl/custom/conversation.py", line 439, in _get_result
due = min(due, start_time + timeout)
TypeError: '<' not supported between instances of 'float' and 'NoneType'
with bot.conversation('@spambot') as conv:
conv.send_message('/start')
response = conv.get_response()
if "I’m afraid some Telegram users found your messages annoying and forwarded them to our team of moderators for inspection." in response:
end_datetime = regex_findall('automatically released on ([\d\w ,:]*)UTC', text)[0]
end_timestamp = datetime.datetime.strptime(end_datetime, "%d %b %Y, %H:%M").timestamp()
Telethon is free software. That means using it is a right: you are free to use it for absolutely any purpose whatsoever. However, help and support with using it is a privilege. If you misbehave or want to do bad things, despite possibly having good intentions, nobody is obligated to help you.
Читать полностью…You have to try and see, it's the export chat history feature of Telegram Desktop, it's behavior is up to server, and should lower the limits for some message related requests
Читать полностью…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.
it seems its only working in iOS and android application. not on Telegram Desktop or Telethon Api
Читать полностью…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.
it's for ?start= deeplinks and sends a hidden param as /start param
, but doesn't matter mostly
conv = adder.conversation('@spambot')Читать полностью…
send_message_ = await conv.send_message('/start')
print('send_message_:', send_message_)
response = await conv.get_response()
Try and see, and "response" is a message object, so in response.text
. and use async with and await properly
If you're not gonna bother use FSM or client.conversation, at least don't use that id + 1 thing... for msg in await msg_sender.get_messages('spambot'):
will get you latest response
for update in (await msg_sender(functions.messages.StartBotRequest(bot="@spambot",peer="@spambot",start_param="/start"))).updates:
for msg in (await msg_sender(functions.messages.GetMessagesRequest(id=[update.id + 1]))).messages:
print('msg:', msg.message)
if "I’m afraid some Telegram users found your messages annoying and forwarded them to our team of moderators for inspection." in msg.message:
end_datetime = regex_findall('automatically released on ([\d\w ,:]*)UTC', text)[0]
end_timestamp = datetime.datetime.strptime(end_datetime, "%d %b %Y, %H:%M").timestamp()
Could anyone tell me what does behind a takeout session mean? How will it affect rate limits?,
Читать полностью…descrip = f'\n```InBrief\n {description}\n```' if description else ''
here the above I send as client.send_message(me, descrip)
The output is not going with syntax tripple back-tick as expected.. what could be the error ?
/channel/TelethonChat/571913
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 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.
channel IDs dont start with -100, thats just added on by the bot API to make it easier to tell the difference between channels, chats and users
Читать полностью…