aahnik / tgcf

The ultimate tool to automate custom telegram message forwarding. Live-syncer, Auto-poster, backup-bot, cloner, chat-forwarder, duplicator, ... Call it whatever you like! tgcf can fulfill your custom needs.
https://github.com/aahnik/tgcf/wiki
MIT License
1.34k stars 797 forks source link

Non integer chat ids are not working for tgcf live mode for source #118

Closed aahnik closed 3 years ago

aahnik commented 3 years ago

Problem

Non-integer chat ids are not working for tgcf live mode

forwards:
  - source: aahnikdaw
    dest: [-1001198424910]

a configuration like this fails in live mode, although succeeds in past mode.

Probable reason

message handlers have something like this on top:

    if chat_id not in from_to:
        return

the chat_id is not in from_to as, from_to is now having the string username or other type of things.

Probable solution

some conversion should take place, and comparison must be done for same type

related docs https://docs.telethon.dev/en/latest/concepts/entities.html

aahnik commented 3 years ago

non int chat ids, work fine in the dest. This problem is only in the source

aahnik commented 3 years ago

It is safe to use usernames/liks/phn no etc v0.2.4 or above.