-
Notifications
You must be signed in to change notification settings - Fork 105
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
Not forwarding messages from deafult topic #98
Comments
Please try now -1001#1 for the default topic |
Hey, thank you for resolving this issue I wanted to ask u one more thing while forwarding messages from groups is it possible to forward the original message sender's username too? |
There are two options here: don't copy, but forward (mode option), or use |
i tried forward mode but the replies don't work in it, is it possible to get usernames in a specific channel using copy mode? |
If you need to forward from a chat, you will need to create a filter like https://github.com/khoben/telemirror/blob/master/telemirror/messagefilters/messagefilters.py#L213, but instead of Getting username from message_sender = await message.get_sender()
message_sender_name = utils.get_display_name(message_sender) # or message_sender.username |
Check updates to ForwardFormatFilter Sample configuration: directions:
- from: [-1001#3]
to: [-1002#1]
filters:
- ForwardFormatFilter:
format: "{sender_title} {sender_username} says:\n\n{message_text}" |
working, thank you so much <3<3 |
Hey khoen, sorry to diusturb you again. I'm using this restricted channel filter `class RestrictSavingContentBypassFilter(MessageFilter):
texts are being forwarded but no the attachments in group topics |
Try logging the line where the media should be downloaded and replaced. More likely "if" gives |
still couldn't figure it out, could u help me with what I'm doing wrong? |
Can you show your config and the changes you made? |
I added the restricted filter in messagefilter.py and class MessageFilter(Protocol): |
Just checked, everything works. To begin with, I want to say that forwarding from channels where this is prohibited violates the Telegram Terms of Service. from .restrictsavingfilter import RestrictSavingContentBypassFilter # noqa: F401 |
Now I'm getting this error: PhotoExtInvalidError: The extension of the photo is invalid (caused by SendMediaRequest) |
Haven't tested it, but maybe taking the file name from the source message could help: cloned_photo: types.TypeInputFile = await client.upload_file(photo, file_name=message.file.name)
message.media = types.InputMediaUploadedPhoto(file=cloned_photo) |
Still getting the same error |
In what environment is the program running? OS/docker, python version and through which telegram client are messages with images sent? |
It would also be great if you sent the images themselves as files here |
|
Really idk why images are sent like random files or with error. Couldn't get the same behavior. Try running via docker or check that all dependencies are updated: |
Hi did you fix that ? |
@corpsepapi You may try to specify the |
I get this error after few time |
|
It's working fine with all the topics except the default one and when I'm only adding only the group id it's forwarding all topics in a single group topic
The text was updated successfully, but these errors were encountered: