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

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.

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

Telethon Chat

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

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

Telethon Chat

What are you even doing, why did you remove the async with, just read the docs of it and implement it as it says

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

Telethon Chat

its related to something about inline query i guess

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

Telethon Chat

this code prints send_message_
but can't get response

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

Telethon Chat

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'

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

Telethon Chat

It will work fine for any bot

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

Telethon Chat

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()

like this?

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

Telethon Chat

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.

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

Telethon Chat

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

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

Telethon Chat

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.

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

Telethon Chat

it seems its only working in iOS and android application. not on Telegram Desktop or Telethon Api

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

Telethon Chat

How can I obtain the registration time of users, such as my own account

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

Telethon Chat

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.

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

Telethon Chat

Oh thanks I didn't notice

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

Telethon Chat

yes I'm trying to use get_messages()

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

Telethon Chat

It's in an async def

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

Telethon Chat

it's for ?start= deeplinks and sends a hidden param as /start param, but doesn't matter mostly

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

Telethon Chat

this method is not for starting bots

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

Telethon Chat

conv = adder.conversation('@spambot')
send_message_ = await conv.send_message('/start')
print('send_message_:', send_message_)
response = await conv.get_response()

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

Telethon Chat

Try and see, and "response" is a message object, so in response.text. and use async with and await properly

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

Telethon Chat

StartBotRequest is not for starting @spambot

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

Telethon Chat

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

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

Telethon Chat

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()


why this code doesn't work 🥲

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

Telethon Chat

Show what it looks like when sent

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

Telethon Chat

Could anyone tell me what does behind a takeout session mean? How will it affect rate limits?,

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

Telethon Chat

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

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

Telethon Chat

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.

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

Telethon Chat

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.

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

Telethon Chat

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

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