-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
what is the correct way to get channel/chat/user name of forwarded message? #47
Comments
It depends whether you want to listen for new Messages or retrieve old ones. |
i listen for updates with below code. i get forward id from "message.fwd_from" but how can i get username and title of channel or User by this id ? def update_handler(client, update, users, chats):
if isinstance(update, types.UpdateNewChannelMessage):
message = update.message
if isinstance(message, types.Message): # Filter by Message to exclude MessageService and MessageEmpty
if not chats[message.to_id.channel_id].megagroup: # Only handle messages from Channels not Supergroups
message_fwd_from_id = None
message_fwd_from_username = None
message_fwd_from_title = None
if message.fwd_from is not None:
if message.fwd_from.channel_id is not None:
message_fwd_from_id = message.fwd_from.channel_id
message_fwd_from_username = ???
message_fwd_from_title = ???
if message.fwd_from.from_id is not None:
message_fwd_from_id = message.fwd_from.from_id
message_fwd_from_username = ???
message_fwd_from_title = ???
client.set_update_handler(update_handler) |
I have the same question as LonamiWebs/Telethon#335 |
From https://docs.pyrogram.ml/pyrogram/Client#pyrogram.Client.set_update_handler
|
…am#48) * fix miss service message for MessageActionChatJoinedByRequest Closes pyrogram#47 --------- Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com>
…am#48) * fix miss service message for MessageActionChatJoinedByRequest Closes pyrogram#47 --------- Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com>
what is the correct way to get channel/chat/user name and title of forwarded message?
p.s : I have the same question as LonamiWebs/Telethon#335
The text was updated successfully, but these errors were encountered: