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
what's this code even doing, topic_id is always equal to msg.id, topics don't become None unless the group has more than a million messages, ask Telegram to fix that then, otherwise, show the logic of your reply_to part
Читать полностью…reply_to = await get_topic_entry_msg_id(group_id, topic_id)Читать полностью…
if reply_to:
await send_with_rotation(gift, group_id, message, reply_to, buttons)
else:
logging.warning(f"⚠️ Can't reply topic id {topic_id} in {group_id}")
previous_availability[slug] = current
except Exception as e:
logging.error(f"❌ Error {slug}: {e}")
the thing is I want my bot to be usable where only users can interact with each other
Читать полностью…wait so channels can also be groups... I have to check if megagroup is true or not... what about gigagroup? its mentioned admin can change it so only they can send message, but can admins don't do that and group keep being a group?
Читать полностью…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.
it's a Telegram feature enabled in that public group. it doesn't have a link because you join by a button not by invite
Читать полностью…I'm getting this while handling UpdateBotChatInviteRequester
. Creating of the link for the bot and handling its invite link works fine.
^exec async
from telethon.tl.functions.messages import ExportChatInviteRequest
entity = await client.get_entity('GiftClaimers')
print((await client(ExportChatInviteRequest(entity))).link)
How to get the private link of my group and also how to leave my group
Читать полностью…Which method can I use to add a "stars" reaction to a message in Telegram
Читать полностью…I really want to thank you, the migrate part works,
Читать полностью…Is there any update? From the beginning I ran the bot never changed the code but here there are changes, and always fail and error
async def get_topic_entry_msg_id(group_id, topic_id):Читать полностью…
try:
msg = await client.get_messages(group_id, ids=topic_id)
return msg.id if msg else None
except Exception as e:
logging.error(f"❌ Failed to take the topic id {topic_id} in {group_id}: {e}")
return None
2025-07-20 12:09:26,140 - ERROR - ❌ Cannot access chat mxeUbzpZ9cZlMGM1: No user has "mxeubzpz9czlmgm1" as username
2025-07-20 12:09:26,492 - INFO - Update id=329333527 is handled. Duration 860 ms by bot id=7859982967
Then ignore gigagroups they're small percentage of chats, same for channels
you should make a helper method to detect chat types more in depth, message.chat object is guaranteed to exist if event.is_channel which includes all the listed types in the docs. you match and ignore based on attributes
they don't matter, treat it as channel from a messaging pov
Читать полностью…https://docs.telethon.dev/en/stable/concepts/chats-vs-channels.html#channels
Читать полностью…Thank you! :)
P.S. I don't know who reported me for spam here, but I couldn't say thank you because of that 😂
Do you know when the second one is being used? What does Public Join Requests mean?
Did I get it right, that the second one doesn't have any attributes set at all?
ExportedChatInvite is their class/type. with two instances, ChatInviteExported / ChatInvitePublicJoinRequests, second object doesn't have a link field
Читать полностью…Hi there!
I'm facing some strange issue with Telethon I can't figure out how it happened. I have a bot managing chat access. The bot creates its own invite link and ignores the rest of the invite links
I have a short code that fetches the invite link
from the request:
@property
def invite_link(self) -> str | None:
if isinstance(self.original_update.invite, ChatInviteExported):
return self.original_update.invite.link
return None
AttributeError: 'ChatInvitePublicJoinRequests' object has no attribute 'link'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return self.original_update.invite.link
File "/app/community_manager/events/__init__.py", line 52, in invite_link
^^^^^^^^^^^^^^^^^
invite_link=event.invite_link,
File "/app/community_manager/handlers/chat.py", line 131, in handle_join_request
await callback(event)
File "/usr/local/lib/python3.11/site-packages/telethon/client/updates.py", line 570, in _dispatch_update
Traceback (most recent call last):
2025-07-16 18:19:26,065 - telethon.client.updates - ERROR - Unhandled exception on handle_join_request
ChatInviteExported
which has the same constructor as ChatInvitePublicJoinRequests
. Therefore both should have link
attributelink
attribute in some cases and if it's an expected behavior that should be handled?Executed Code 👑
from telethon.tl.functions.messages import ExportChatInviteRequest
entity = await client.get_entity('GiftClaimers')
print((await client(ExportChatInviteRequest(entity))).link)
/channel/+hpdljEmc_uo2ZTk0Читать полностью…
Print(await client(ExportChatInviteRequest(entity)))
i am unable to get the link even with .link
python ChatInviteExported(link='/channel/+iVKmpW9XKfs1Mjdk', admin_id=7900050917, date=datetime.datetime(2025, 7, 16, 16, 48, 47, tzinfo=datetime.timezone.utc), revoked=False, permanent=False, request_needed=False, start_date=None, expire_date=None, usage_limit=None, usage=None, requested=None, subscription_expired=None, title=None, subscription_pricing=None)Читать полностью…
By making the int(chat_id) and as you told me by making await them
Читать полностью…start by awaiting the client calls
and spam reported accounts are unlikely to create Chat groups too same as supergroups