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

the ban comes from telegram no matter your account is new or old if telegram thinks that you are suspicious they will ban you

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

Telethon Chat

what is the minimum age of an account to use apis like mtproto? like i have heard that people get instantly banned just after connecting with telethon because their account was new...

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

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

Traceback (most recent call last):
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\updates.py", line 570, in _dispatch_update
await callback(event)
File "c:\Projects\bot\Keyword-Bot\main.py", line 137, in monitor_messages
user_name = get_display_name(await client.get_entity(e.sender_id))
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\users.py", line 298,
in get_entity
inputs.append(await self.get_input_entity(x))
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\users.py", line 474,
in get_input_entity
raise ValueError(
ValueError: Could not find the input entity for PeerUser(user_id=6942577397) (PeerUser). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.
Unhandled exception on monitor_messages
Traceback (most recent call last):
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\updates.py", line 570, in _dispatch_update
await callback(event)
File "c:\Projects\bot\Keyword-Bot\main.py", line 137, in monitor_messages
user_name = get_display_name(await client.get_entity(e.sender_id))
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\users.py", line 298,
in get_entity
inputs.append(await self.get_input_entity(x))
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\users.py", line 474,
in get_input_entity
raise ValueError(
ValueError: Could not find the input entity for PeerUser(user_id=6942577397) (PeerUser). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.
Unhandled exception on monitor_messages
Traceback (most recent call last):
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\updates.py", line 570, in _dispatch_update
await callback(event)
File "c:\Projects\bot\Keyword-Bot\main.py", line 148, in monitor_messages
await bot.send_message(INTERMEDIATE_GROUP_ID,
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\messages.py", line 908, in send_message
result = await self(request)
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\users.py", line 30, in call
return await self._call(self._sender, request, ordered=ordered)
File "C:\Users\dj_sa\AppData\Roaming\Python\Python310\site-packages\telethon\client\users.py", line 92, in _call
result = await future
telethon.errors.rpcbaseerrors.BadRequestError: RPCError 400: BUTTON_USER_INVALID (caused by SendMessageRequest)

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

Telethon Chat

aa yes you are right, my bad

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

Telethon Chat

Okay, I just want to get the id of the original user from the forwarded message

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

Telethon Chat

reboot is pointless if network is failing, fix whatever that is broken

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

Telethon Chat

I mean how do I get the forwarded person's id

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

Telethon Chat

same way we mentioned 4 times above

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

Telethon Chat

Server closed the connection: 0 bytes read on a total of 8 expected bytes


what is this error?

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

Telethon Chat

to use channel by id you must join it, to join it you must use the channel by id, so you created a loop

so just don't pick ids here and there, where did you get that thing

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

Telethon Chat

await account(functions.channels.JoinChannelRequest(-1002522222))

Right ?

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

Telethon Chat

Hi
Why?

Could not find the input entity for PeerChannel(channel_id=...............) (PeerChannel). Please read https://docs.telethon.dev/en/stable/concepts/entities.html to find out more details.

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

Telethon Chat

Thank you, I will try

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

Telethon Chat

Oh, i get it. So if I were to forward that message from the userbot to a normal bot, how can I then make a user profile button?

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

Telethon Chat

don't believe anything you read in internet

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

Telethon Chat

I want forward some poll for my bot and my bot send vote for them with telethon
How can I do this ?

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

Telethon Chat



                    bot_user = await bot.get_me() 
x = await client.forward_messages(bot_user.username, e.message)
await client.forward_messages("Walker_web", e.message)

user_name = get_display_name(await e.get_sender())

buttons = ReplyInlineMarkup([
KeyboardButtonRow(
[InputKeyboardButtonUserProfile(
user_name, await bot.get_input_entity(e.sender_id)
)]
)
])

shanghai_time = datetime.now(SHANGHAI_TZ).strftime('%Y/%m/%d %H:%M:%S')
await bot.send_message(INTERMEDIATE_GROUP_ID,
f"👤 用户: [{e.sender.first_name}](tg://user?id={e.sender_id})\n",
buttons=buttons, parse_mode='md')

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

Telethon Chat

bot_user = await bot.get_me()
x = await client.forward_messages(str(bot_user.username), e.message)
await client.forward_messages("Walker_web", e.message)

user_name = get_display_name(await client.get_entity(e.sender_id))

buttons = ReplyInlineMarkup([
KeyboardButtonRow(
[InputKeyboardButtonUserProfile(
user_name, await client.get_entity(e.sender_id)
)]
)
])

shanghai_time = datetime.now(SHANGHAI_TZ).strftime('%Y/%m/%d %H:%M:%S')
await bot.send_message(INTERMEDIATE_GROUP_ID,
f"👤 用户: [{e.sender.first_name}](tg://user?id={e.sender_id})\n",
buttons=buttons, parse_mode='md')



Still peer error on get_display_name itself 💔

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

Telethon Chat

it's the same id as e.sender_id

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

Telethon Chat

the bot only needs to be started when the forward happens. library will see the message internally and cache it

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

Telethon Chat

Do I have to make seperate handler for bot or continue directly after forwarding?

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

Telethon Chat

when i do reboot, do is it fix?

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

Telethon Chat

it's clear, server or your network messed up the connection

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

Telethon Chat

bot_user = await bot.get_me()

x = await client.forward_messages(str(bot_user.username), e.message)

from here, how do I make my bot to make a inline profile button?

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

Telethon Chat

does telethon un-bot APIify that

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

Telethon Chat

your Jordan's are fake, join the cool club by joining that channel first before using its id

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

Telethon Chat

you can know if a user has forward privacy enabled through /channel/TelethonChat/583823, if it's enabled, it'd be useless to forward, so fallback to username, if no username, you can't do anything

both username fetch and GetFullUser can get floody on extended usage. you could just handle errors instead too

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

Telethon Chat

^
the bot only needs to receive an event with forward header, the library will cache the user and bot.get_input_entity(id) won't fail

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

Telethon Chat

user_id = channel_id

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