-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
[Plugin] Sender #478
[Plugin] Sender #478
Conversation
This is amazing work 👏🔥🎊 Thanks for your efforts in improving tgcf 😎 |
Thank you! Your project helps me a lot, and for that I want to help as best as I can ^_^. |
The plugin had a problem with sending media files. The force push just now fixes the problem. Now, I can confirm the plugin works as expected. Sorry for that 🙏. |
If you try to send messages to your own channel, why don't you use the bot directly? |
I want to forward the messages from a public channel, and telegram doesn't allow bot to join a public channel unless the owner of that channel adds it. So the flow will be like, log in user account to read public channels messages, then use bot / other user account to send them. |
I understand now. This is a cool feature. This could be developed further. Make a list of bots, when one hits the limit of forwarded messages, change to next. This will help with copying big chats. You think is possible? |
I see thank you for the idea and info. I didn't know that bots have limits for forwarding messages. This is possible, but I need to know exactly what's the limit for a bot for sending messages and for how long the cool down is e.g. 1000 messages per hour. If I can get that, I could think of a way to implement it. |
Great information, @poliandro, thank you. I noticed that there are differences in the limits between sending and forwarding messages. This plugin doesn't support forwarding messages, as it's intended for different accounts that don't have access to the original messages, channel, or group. Therefore, it will use the sending limit. Additionally, looking at how tgcf is currently implemented, only the past mode has a higher chance of reaching the limit, but even then, we can set a delay between sending messages. It is unlikely to be limited using live mode, unless the source itself spams messages, which I have never experienced until this day using Telegram. We would need more real tests and real use cases before we can further improve tgcf in working around Telegram limitations. |
Yes, past mode is the one that will mostly hit limits when the source has many messages, but even live mode can encounter issues . What is the difference between sending and forwarding? Your plugin will work in both live and past, right? |
I see, the issue is still open. Great solution, I can imagine a way to do it, but might restructure most of the current code. Still, implementing the solution can't ensure that it'll work, unless the flood wait can be reproduced. Only sending forwarding messages normally can be tested easily. Sending is creating new messages, forwarding is just sharing a reference to the already received message without changing anything just like the forward function in Telegram app. Of course, the plugin should work in both modes. |
OK, sending is copy message without forward tag. Thank you for the explanation. |
thank you @MobCode100 for this awesome plugin... After going through your code, I understood how cleanly its implemented within the current structure of tgcf... Its a cool and awesome feature to have. |
Thank you for your constructive comments, and your efforts for maintaining this project. Welcome back we missed you! Thank you so much for merging my pull requests. |
@MobCode100 Is this plugin working? Because your tgcf fork seems to be unavailable. |
It's already merged to the main branch that's why I remove my fork. It should work, the last time I tried it. |
bro when forwarding files using this plug-in it download file and then send it |
That's how it is. That's intentional. |
can i bypass downloading
|
I don't think so, because to send as another account requires downloading. Unless you made your own plugin or you modify existing. |
how can i modify i have code is it can be used `class TgcfSender(TgcfPlugin):
|
Fork the branch and make a pull request once done. |
Plugin description:
Change the sender of forwarded messages other than the currently logged in user/bot.
Problems:
Solution:
tgcf will login an additional client and use it to forward received messages with the condition that the client has permission to send messages to the destinations.
Key changes:
TgcfSender
plugin class.client
insideTgcfMessage
class to use as the sender insend_message
function.ASYNC_PLUGIN_IDS
inplugin_models.py
containing IDs of plugins that need to load asynchronously (e.g. login a client).load_async_plugins
function to load asynchronous plugins.I think my use case of tgcf is a bit weird here, but the plugin satisfies my needs. I tried my best to follow existing code style. Sorry if I made mistakes and please do point out for my self improvement. Feel free to change anything that I've made. Thank you so much for this great project!
I have fully read and understood the terms and conditions laid down in the general Contributor License Agreement