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
the ban comes from telegram no matter your account is new or old if telegram thinks that you are suspicious they will ban you
Читать полностью…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...
Читать полностью…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.
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)
Okay, I just want to get the id of the original user from the forwarded message
Читать полностью…reboot is pointless if network is failing, fix whatever that is broken
Читать полностью…Server closed the connection: 0 bytes read on a total of 8 expected bytes
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
await account(functions.channels.JoinChannelRequest(-1002522222))
Right ?
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.
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?
Читать полностью…I want forward some poll for my bot and my bot send vote for them with telethon
How can I do this ?
ㅤ
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')
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')
the bot only needs to be started when the forward happens. library will see the message internally and cache it
Читать полностью…Do I have to make seperate handler for bot or continue directly after forwarding?
Читать полностью…it's clear, server or your network messed up the connection
Читать полностью…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?
your Jordan's are fake, join the cool club by joining that channel first before using its id
Читать полностью…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
^
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