telethonchat | Unsorted

Telegram-канал telethonchat - Telethon Chat

6095

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

client.send_message(chat, "<blockquote>test message</blockquote>", parse_mode="html")

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

Telethon Chat

Is there a way to find out if Ive voted on a poll before?
Is there a method for doing this?

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

Telethon Chat

Hi! When a user messages me in private for the first time, is it possible to extract their phone number country (e.g. "🇷🇺 Russian Federation") and account registration date (e.g. "Joined Telegram in June 2022") using Telethon?

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

Telethon Chat

I want telegram receiver robot who have it?

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

Telethon Chat

can i send my file ?

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

Telethon Chat

as it turned out it is more profitable to send message in a chat using simple requests lib:

    url = f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage"
params = {
"chat_id": chat_id,
"text": text,
"parse_mode": "HTML"
}

response = requests.post(url, json=params)

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

Telethon Chat

start client inside def

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

Telethon Chat

i did this before client

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

Telethon Chat

set it before client

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

Telethon Chat

bro i am getting new issue how to play audio bro

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

Telethon Chat

TL Reference for EditForumTopic

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

Telethon Chat

Documentation for send_read_acknowledge

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

Telethon Chat

bots only get messages by id. /channel/TelethonChat/606776

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

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 def connect(self: TelegramClient, timeout: int = 20) -> None:
for attempt in range(2):
try:
await asyncio.wait_for(super().connect(), timeout)
return True
except OSError:
return print(f"Connection failed {self._phone}")
except TimeoutError as error:
self._proxy = None
print(f"Connection timeout, retrying in {error.seconds}, {attempt} attempt.")
await asyncio.sleep(error.seconds)

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

Telethon Chat

how can I send message like this:

test message

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

Telethon Chat

💻 Код:

from telethon.tl.functions.messages import GetPeerSettingsRequest

settings = await client(GetPeerSettingsRequest(6434672004))
s = settings.settings

s.registration_month, s.phone_country


✅ Результат:
('09.2023', 'PL')

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

Telethon Chat

I think you forgot to send the code

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

Telethon Chat

Documentation for send_file

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

Telethon Chat

hallo i have probel with erorr Error a TLObject was expected when i send album ,. this my detail code . please help

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

Telethon Chat

I have to use .start otherwise impossible to pass a token

    app = TelegramClient(
"my_bot",
api_id=api_id,
api_hash=api_hash,
# loop=loop,
).start(bot_token=TELEGRAM_BOT_TOKEN)

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

Telethon Chat

like
def main():
await bot.start()
bot.run_until_disconnected()

asyncio.run(main())

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

Telethon Chat

or start client inside async def and pass it to asyncio.run

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

Telethon Chat

/channel/TelethonChat/670842

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

Telethon Chat

I never actually received the remaining photos till now
Is me calling client.catch_up messing with something?
Not that the thing works anyways (I still miss updates when offline)

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

Telethon Chat

TL Reference for CreateForumTopic

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

Telethon Chat

It's intended Telegram design to delay updates. Telethon should already be catching up to missing ones if you successfully received latest gallery item

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

Telethon Chat

📢 Bot Log:
❌ Error in /extract:

Traceback (most recent call last):
File "/home/theonegi/public_html/Helping/telethon/public/yt.py", line 128, in extract_handler
album_messages = await self.client.get_messages(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/theonegi/virtualenv/public_html/Helping/telethon/3.11/lib/python3.11/site-packages/telethon/client/messages.py", line 605, in get_messages
return await it.collect()
^^^^^^^^^^^^^^^^^^
File "/home/theonegi/virtualenv/public_html/Helping/telethon/3.11/lib/python3.11/site-packages/telethon/requestiter.py", line 113, in collect
async for message in self:
File "/home/theonegi/virtualenv/public_html/Helping/telethon/3.11/lib/python3.11/site-packages/telethon/requestiter.py", line 74, in anext
if await self._load_next_chunk():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/theonegi/virtualenv/public_html/Helping/telethon/3.11/lib/python3.11/site-packages/telethon/client/messages.py", line 184, in _load_next_chunk
r = await self.client(self.request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/theonegi/virtualenv/public_html/Helping/telethon/3.11/lib/python3.11/site-packages/telethon/client/users.py", line 30, in call
return await self._call(self._sender, request, ordered=ordered)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/theonegi/virtualenv/public_html/Helping/telethon/3.11/lib/python3.11/site-packages/telethon/client/users.py", line 92, in _call
result = await future
^^^^^^^^^^^^
telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetHistoryRequest)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/theonegi/public_html/Helping/telethon/public/yt.py", line 136, in extract_handler
print(f"Error getting album messages: {e}")
OSError: [Errno 5] Input/output error

Bots can't send albums?

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

Telethon Chat

Can we create or delete threads in topics chat?

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

Telethon Chat

client._init_request.proxy = None

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