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

I know)
I want to do this using Telethon

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

Telethon Chat

How to handle photos?? How to find out if the message is a photo??

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

Telethon Chat

it's about Telethon
:D

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

Telethon Chat

There's one made by Iranians where you can move to if you think you'll be more cozy, and it's offtopic though

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

Telethon Chat

bro they should change the group name to Telethon IR
it's crazy how many Persians are here💀the admins should learn farsi fr bro

like the last 20 msgs are all persians

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

Telethon Chat

Hello guys
If I want to write a script using Telethon that keeps my account active and always online, showing the "online" status to everyone, could this lead to the deletion of my account?

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

Telethon Chat

Just don't drift around the main goal, what are you intending
telethon is south of normal as of V1, but everything has a coping version of a solution

stickers are special case for users and allowed to have no file_reference for most sticker types. the rest media types are only allowed for bots to be stored in a guaranteed way, for users, it's much more performant to pass an object in memory, since they're short-lived

if it's RAM you're worried about, you can use telethon.utils.get_input_media(message.media) to get more minimal object meant for sending

otherwise if you're passing the object to other processes or keeping them unstably over restarts, it's needed to go the manual way for no bots by pickling + base64

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

Telethon Chat

I think I'll do that finally 😞

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

Telethon Chat

storing isn't for users but bots. it will expire within couple hours anyways, just pass the object in memory.

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

Telethon Chat

you misunderstood what's the function for, that meant you have a file_id of other libraries, and to pass that bot-api style "string" file_id to get telethon object.

The int document id from telethon itself can't be used alone, it needs access hash too. you already have access to binary interface with telethon, storing object is trivially easy.

if you still don't want to, telethon's message.file.id still works for documents, stickers are documents too

you can flex tape fix it for photos too, put this line at top:

telethon.types.PhotoSize.location = type('', (int,), {"__getattr__": lambda s, _: s})()

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

Telethon Chat

Im already using client.connect

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

Telethon Chat

hello. when adding sessions (working sessions) the code asks for authorization (Please enter your phone (or bot token)). adding one session at a time manually is not an option because I need to work with hundreds of sessions.

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

Telethon Chat

I could not find any method for it in documentation

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

Telethon Chat

You passed something invalid to the function, show it

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

Telethon Chat

I don't think I do that
I use loop.close directly

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

Telethon Chat

Hi, how can I change the list of allowed reactions in 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

nah bruv that place is such a desert

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

Telethon Chat

That is not related to Telethon. Please move to a different group with the correct topic to continue that conversation

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

Telethon Chat

I did the same thing for entire 2 months and I haven't been getting any limitation or banned

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

Telethon Chat

Actually I'm not worried about anything, but I'm trying to use the best way...
I exceptionally think if I could be able use a not long integer, then users could either, so it will give me some opportunity to make some options for them and not just storing, I saw pyrogram library which is outdated by 3 years ago can re-use all types of files or medias just using an as not long integer as document.id's of telethon , which was completely interesting,
Btw I don't think so using this trash library shall make my code cleaner , it shan't remain my code clean as well, but about Telegram http-api?

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

Telethon Chat

But preferably just when I become disappointed of file_id

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

Telethon Chat

What if I get file_id from somewhere but telethon? Will it work?

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

Telethon Chat

It worked alright with stickers, but after that I tried to use a video file_id, when I used to pass the returned InputDocument object and after calling the function, it occurred to

FileReferenceEmptyError: The file reference must exist to access the media and it cannot be empty (caused by SendMediaRequest)

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

Telethon Chat

I passed file id of a sticker (773947703670341880) by passing Message.document.id

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

Telethon Chat

/channel/TelethonChat/580052

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

Telethon Chat

if it raises "NotParticipantError". it means that the user is not a member of your channel. you can except the error.

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

Telethon Chat

hello. how can I check if a user is subscribed to my channel in telethon ?

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

Telethon Chat

can you send the full code?

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

Telethon Chat

Your code didn't work actually,
It occurred a BufferError with below traceback:

  File "<string>", line 7, in file_id_to_object
  File "/home/orDuncan/.local/lib/python3.8/site-packages/telethon/extensions/binaryreader.py", line 37, in read_int
    return int.from_bytes(self.read(4), byteorder='little', signed=signed)
  File "/home/orDuncan/.local/lib/python3.8/site-packages/telethon/extensions/binaryreader.py", line 60, in read
    raise BufferError(
BufferError: No more data left to read (need 4, got 0: b''); last read None

And it would be great if it could work...
Is there any solution?
It can release me storing file_reference, document type and file id and lots of other stuff, because it's nothing but a integer, not three different strings..

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