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
Hello, I am trying to send a message to a channel where I have enabled the discussion/comments feature.
message = await client.send_message(channel, "post")
await client.send_message(channel, 'test comment', comment_to=message.id)
is there is method to ignore the answer just timeout it 1 sec if not answer?
Читать полностью…what alternative for this
try:
client(GetBotCallbackAnswerRequest(
peer=bot_username,
msg_id=msg[0].id,
data=button_id
))
except:
pass
"sendmessagerequest" isn't an error. the part before it is the error, show that
Читать полностью…it could be, In your code more likely, check the "channel" pointing to what you expect that id belong to and the same for id
Читать полностью…edit_admin is "add an admin", there is no other way to promote someone in supergroups, it implicitly does InviteToChannel on server if not joined
Читать полностью…When creating a supegroup is it possible to add an admin or client.edit_admin()
is only way ?
You can retrieve registration_month, phone_country, photo_change_date, and name_change_date using the Telethon Raw method, but only for users who have sent you a message first.
from telethon.tl.functions.messages import GetPeerSettingsRequestЧитать полностью…
from telethon.tl.types import PeerUser, PeerChat, PeerChannel
peer = await client.get_entity("ankify")
settings = await client(GetPeerSettingsRequest(peer))
print(settings)
^exec async
from telethon.tl.functions.messages import GetPeerSettingsRequest
from telethon.tl.types import PeerUser, PeerChat, PeerChannel
peer = await client.get_entity("ankify")
settings = await client(GetPeerSettingsRequest(peer))
print(settings)
Update:
At the end, it just worked. There was an exagerated delay in bigger groups, but finally it worked.
Now, a new problem is that it appears to be a "limit" in 10.000 usernames. I think that it may be something related to the cappacity of a JSON, but I think there are still a lot bytes to fill the document in the creation.
I will try to debug it manually and keep the update.
is there a method for sending the random greet sticker telegram suggests upon messaging in an empty private chat?
Читать полностью…it won't. unless you use client.loop.run_until_complete(asyncio.wait_for(...))
and must wrap the click() or client() in actual async def
try:Читать полностью…
await asyncio.wait_for(msg[0].click(data=button_id), timeout=1)
except TimeoutError:
pass
it's as fast as Telegram server and the bot's server, ask them.
if the bot is faulty and doesn't do correct answer(), the method will wait ~15 seconds to expire, you can read about asyncio tasks to run the click in background for this case
you installed it wrong, confirm it was the correct pip for that python, minimum usable is V1.27
Читать полностью…because is not like i try to contact via join request, is like i contact in old way, with ID, so i encounter sendmessagerequest, i need to replicate the new way, that one is permitted with the bot api, and the way is permitted when i click in join request, and after "send message" so i can contact user, and user see in the high "xxxx is and admin of channel you request to join"
Читать полностью…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.
sometimes get_messages(channel, ids=id) returns None, it's happened 3-4 times, crashing my script and it works after i restart, is it a bug?
Читать полностью…If you're talking about group members, that's the maximum amount server returns
Читать полностью…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.
Executed Code 👑
from telethon.tl.functions.messages import GetPeerSettingsRequest
from telethon.tl.types import PeerUser, PeerChat, PeerChannel
peer = await client.get_entity("ankify")
settings = await client(GetPeerSettingsRequest(peer))
print(settings)
PeerSettings(settings=PeerSettings(report_spam=True, add_contact=True, block_contact=True, share_contact=False, need_contacts_exception=True, report_geo=False, autoarchived=True, invite_members=False, request_chat_broadcast=False, business_bot_paused=False, business_bot_can_reply=False, geo_distance=None, request_chat_title=None, request_chat_date=None, business_bot_id=None, business_bot_manage_url=None, charge_paid_message_stars=None, registration_month='05.2015', phone_country='IN', name_change_date=None, photo_change_date=None), chats=[], users=[])Читать полностью…