Skip to content
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

Allow hiding sender's name and/or caption when forwarding #3197

Closed
Architector4 opened this issue Oct 29, 2021 · 12 comments
Closed

Allow hiding sender's name and/or caption when forwarding #3197

Architector4 opened this issue Oct 29, 2021 · 12 comments
Labels
enhancement Nice to have things that are not a bug

Comments

@Architector4
Copy link

Architector4 commented Oct 29, 2021

Telegram Desktop 3.0 client has introduced the ability to "change how the messages will be sent" when forwarding (see attached image): https://desktop.telegram.org/changelog#v-3-0-31-08-21

From that, I assume it would be possible for Telethon to expose that as well. However, I do not see any way to do the same thing in the function telethon.client.messages.MessageMethods.forward_messages. Either I'm blind and missed it, or it's not in Telethon?

image

@Architector4 Architector4 added the enhancement Nice to have things that are not a bug label Oct 29, 2021
@soroushfathi
Copy link

soroushfathi commented Jan 6, 2022

you can use send_message for hide senders name.
And for caption, you can put caption argument empty :)

msg = event.message
msg.raw_text = ""
await client.send_message(chat, msg)

telethon.client.messages.MessageMethods.send_message

@Architector4
Copy link
Author

you can use send_message for hide senders name. And for caption, you can put caption argument empty :)

Oh, yeah, that does work and makes sense - just taking the message object and sending it as self - all the media stays there too lol

Though still, since at least official Telegram offer this functionality as a type of a forward, I feel like it's still a good idea to implement this with the forward_messages method, or at least mention this trick in its documentation.

@soroushfathi
Copy link

you can use send_message for hide senders name. And for caption, you can put caption argument empty :)

Oh, yeah, that does work and makes sense - just taking the message object and sending it as self - all the media stays there too lol

Though still, since at least official Telegram offer this functionality as a type of a forward, I feel like it's still a good idea to implement this with the forward_messages method, or at least mention this trick in its documentation.

yeah👍 i dont know why still they didn't implement this with forward message

@du5
Copy link

du5 commented Apr 7, 2022

you can use send_message for hide senders name. And for caption, you can put caption argument empty :)

Oh, yeah, that does work and makes sense - just taking the message object and sending it as self - all the media stays there too lol

Though still, since at least official Telegram offer this functionality as a type of a forward, I feel like it's still a good idea to implement this with the forward_messages method, or at least mention this trick in its documentation.

I also had this problem, I modified the parameters and it worked du5@64733fa

@alm0ra
Copy link

alm0ra commented Aug 20, 2022

@Lonami have same issue

@Lonami
Copy link
Member

Lonami commented Apr 6, 2023

This is unlikely to happen in the near future so I will be closing the issue. We can reopen it if there's still interest once the time is right. Note that it's possible to use raw API if you need features not exposed by the friendly API.

@Lonami Lonami closed this as completed Apr 6, 2023
@matveygal
Copy link

Guys you didn't read the docs. Just use copy_message. Here are the Docs

@sophronesis
Copy link

sophronesis commented May 12, 2023

Guys you didn't read the docs. Just use copy_message. Here are the Docs

It's not telethon docs, it even doesn't replace telethon, it's just simple bot wrapper

@sophronesis
Copy link

Best possible way to solve this is to just use Pyrogram whose copy_message() method does exactly this.

@Architector4
Copy link
Author

Best possible way to solve this is to just use Pyrogram whose copy_message() method does exactly this.

Between using an entirely different unrelated package for dealing with Telegram and rewriting all my code to use that, and doing a simple albeit a bit obtuse thing that Telethon has that achieves the same purpose, I think I'd rather choose the latter lmao

@YQHan
Copy link

YQHan commented Dec 12, 2023

Best possible way to solve this is to just use Pyrogram whose copy_message() method does exactly this.

Between using an entirely different unrelated package for dealing with Telegram and rewriting all my code to use that, and doing a simple albeit a bit obtuse thing that Telethon has that achieves the same purpose, I think I'd rather choose the latter lmao

I got a problem, when the message has markdown style, like text, the send_message with formatting_entities=message.entities doesn't work well.

@YQHan
Copy link

YQHan commented Dec 12, 2023

Best possible way to solve this is to just use Pyrogram whose copy_message() method does exactly this.

But copy_message() doesn't work well when the message has complicated styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Nice to have things that are not a bug
Projects
None yet
Development

No branches or pull requests

8 participants