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

Documentation for get_messages

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

Telethon Chat

this link from @iproxy

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

Telethon Chat

the secret should be in hex

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

Telethon Chat

from telethon import TelegramClient, connection
from config import api_hash, api_id

client = TelegramClient(
'session', api_id, api_hash,
connection=connection.ConnectionTcpMTProxyRandomizedIntermediate,
proxy=('95.169.173.237', 8443, 'eeNEgYdJvXrFGRMCIMJdCQ')
)

async def saved_messages():
# Get the user
me = await client.get_me()
await client.send_message('me', 'it worked :D')

# Run the client
with client:
client.loop.run_until_complete(saved_messages())


https://docs.telethon.dev/en/stable/basic/signing-in.html

Why dosent this work...
the secret value is valid
/channel/proxy?server=95.169.173.237&port=8443&secret=eeNEgYdJvXrFGRMCIMJdCQ

ValueError: MTProxy secret must be a hex-string representing 16 bytes

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

Telethon Chat

I'm a little confused. Can you please give an example for UpdateInlineBotCallbackQuery?

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

Telethon Chat

there was nothing about them in the docs, just found this:

https://tl.telethon.dev/constructors/input_client_proxy.html

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

Telethon Chat

does this work for making a userbot use a mtproto proxy?

proxy = {
'address': 'PROXY_ADDRESS',
'port': 443,
'secret': b'PROXY_SECRET'
}

# Create the client and set up MTProto proxy
client = TelegramClient(
StringSession(),
api_id,
api_hash,
connection=ConnectionTcpMTProxy,
proxy=(proxy['address'], proxy['port'], proxy['secret'])
)

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

Telethon Chat

But apparently the buttons are not in the callback queries.🙁

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

Telethon Chat

In this case I have to use get_permissions multiple times to be able to change the text and data of the buttons using it
But apparently this is not working properly

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

Telethon Chat

idk if buttons are editable hmm

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

Telethon Chat

i'd store the buttons in a variable then use after each edit

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

Telethon Chat

I am sending multiple inline buttons with a message. I want to change the text and data of that button when the user clicks on one of the inline buttons (only that button).
But when the user clicks on the buttons, the buttons are not there in the update that comes.

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

Telethon Chat

callback query returns the message event no?

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

Telethon Chat

Did you create the session in the same runtime/client object it was terminated at?

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

Telethon Chat

Using
(Timeouts)
try:
with client:
result = client.get_me(timeout=10)
except TimeoutError:
print("Session might be terminated.")

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

Telethon Chat

from telethon import TelegramClient, connection
from config import api_hash, api_id

client = TelegramClient(
'session', api_id, api_hash,
connection=connection.ConnectionTcpMTProxyRandomizedIntermediate,
proxy=('194.120.230.96', 85, '7hs4KdquAf0HwOI8kXxmQARpdmlmLmly')
)

async def saved_messages():
# Get the user
me = await client.get_me()

# Send 'hi' to saved messages
await client.send_message('me', 'hi')

# Run the client
with client:
client.loop.run_until_complete(saved_messages())

i tried like 10000 proxies and they dont connect, when i use a normal telegram client they work, but i get this error when i use the same proxy with a userbot:

Attempt 1 at connecting failed: ConnectionError: Proxy closed the connection after sending initial payload

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

Telethon Chat

i just copied the secret from a proxy link

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

Telethon Chat

who on earth uses ai for coding python ;/

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

Telethon Chat

you're probaby using events, which are telethon's custom types, wrapping the original updates.

i just wanted to highlight that the original update does not contain the message object

the event should have a method to refetch the message by id

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

Telethon Chat

that's the types reference. the docs are docs.telethon.dev

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

Telethon Chat

i don't know. i've never used mtproxies.

read the docs or code

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

Telethon Chat

correct.
https://tl.telethon.dev/constructors/update_bot_callback_query.html
https://tl.telethon.dev/constructors/update_inline_bot_callback_query.html

you can however refetch the message

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

Telethon Chat

I thought the buttons were in the callback queries
and I wanted to get the buttons this way and just change the text and data of the button in question
then resend them

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

Telethon Chat

is there any way to connect a userbot via mtproto proxy? (for countries that telegram is cencorshipped in)

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

Telethon Chat

and for them to change, a function can make them for you

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

Telethon Chat

Is there no way to change the text and data of just one button?
After clicking it

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

Telethon Chat

then get the buttons from there

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

Telethon Chat

there is no such argument

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

Telethon Chat

Use Telethon events:
from telethon.events import Raw

@client.on(Raw)
async def handle_raw(event):
print(f"Received event: {event}")

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

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.

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