Code Monkey home page Code Monkey logo

Comments (8)

aahnik avatar aahnik commented on May 26, 2024

the from and to fields can be either chat id or visible name

NEW FEATURE: 🎉 You may use the chat_id instead of the visible name. To get the chat id of a particular chat/group/channel run get_chat_id.py and then enter the user-name/phone/link of the chat.

An example is here:

get chat id

the integer you get in the second line of output is the chat id

After getting the chat id you can use this in the config.ini file:

[my config]
from = 90984098590
to = My Channel
offset = 0
; the from and to fields can be either chat id or visible name

from tgcf.

aahnik avatar aahnik commented on May 26, 2024

@lit34 Please test the new feature, and give your feedback.

from tgcf.

lit34 avatar lit34 commented on May 26, 2024

Thank you for your quick response. I tried again with the new chat ids but I receive an error
"ValueError: Could not find the input entity for <telethon.tl.types.PeerUser object at 0x000002700F7EFEE0>"

After I research a little on internet I found a solution here
https://www.xspdf.com/resolution/53139794.html
"Every channel id is a 13 characters negative integer. So the id for this channel is -1001035716040 and not 1035716040 as printed."

So I modified chat ids by putting -100 in front of them. It worked! Now the only problem I encounter is the flood messages that forces the script to take 5 min pause. If there are many files to be copied the pause is getting bigger, 60 minutes. I guess there are some limits that Telegram enforces. Are these known? Maybe an option to copy at a slower pace will not trigger these bans? A nice enhancement could be the option to copy only some types of posts and exclude others (video, audio, photos, links, excluding posts that contain certain words etc).

Thank you again for your effort, your script is the only one that worked for me, and I tried quite a few of them.

from tgcf.

aahnik avatar aahnik commented on May 26, 2024

hi @lit34 you can easily get chat ids by running get_chat_id.py. And it works, directly, I have tested.

You don't need to add -100 in front.

I think you made some kind of error.

I highly recommend using visible names. If visible names collide, then take the link of the channel/group and generate the chat id.

FloodWait is caused by Telegram, because it puts some limitations on the no. of messages you can send in a given time.

Sending messages slowly is a bad idea, in my opinion. That will take more total time, for a person who has fewer messages.

Waiting when we encounter FloodLimits is better.

from tgcf.

aahnik avatar aahnik commented on May 26, 2024

For general help and discussion please chat with me on Telegram.

Click this button telegram-chat

from tgcf.

aahnik avatar aahnik commented on May 26, 2024

A nice enhancement could be the option to copy only some types of posts and exclude others (video, audio, photos, links, excluding posts that contain certain words etc).

Thats a good idea, but I am currently busy with other work. You are most welcome to contribute the new feature.

from tgcf.

aahnik avatar aahnik commented on May 26, 2024

@lit34 From now on, you can directly use username in from and to

from tgcf.

lit34 avatar lit34 commented on May 26, 2024

I deleted all and setup a fresh configuration. Now it works! Keep up the good work!

from tgcf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.