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.29k stars 775 forks source link

username not found'why it can just skip? #457

Closed Tubyitamar closed 7 months ago

Tubyitamar commented 1 year ago

│ 189 │ with Runner(debug=debug) as runner: │ │ ❱ 190 │ │ return runner.run(main) │ │ 191 │ │ 192 │ │ 193 def _cancel_all_tasks(loop): │ │ │ │ /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py:118 in run │ │ │ │ 115 │ │ │ │ 116 │ │ self._interrupt_count = 0 │ │ 117 │ │ try: │ │ ❱ 118 │ │ │ return self._loop.run_until_complete(task) │ │ 119 │ │ except exceptions.CancelledError: │ │ 120 │ │ │ if self._interrupt_count > 0: │ │ 121 │ │ │ │ uncancel = getattr(task, "uncancel", None) │ │ │ │ /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py:653 in │ │ run_until_complete │ │ │ │ 650 │ │ if not future.done(): │ │ 651 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │ │ 652 │ │ │ │ ❱ 653 │ │ return future.result() │ │ 654 │ │ │ 655 │ def stop(self): │ │ 656 │ │ """Stop running the event loop. │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/tgcf/past.py:35 in forward_job │ │ │ │ 32 │ async with TelegramClient( │ │ 33 │ │ SESSION, CONFIG.login.API_ID, CONFIG.login.API_HASH │ │ 34 │ ) as client: │ │ ❱ 35 │ │ config.from_to = await config.load_from_to(client, config.CONFIG.forwards) │ │ 36 │ │ client: TelegramClient │ │ 37 │ │ for from_to, forward in zip(config.from_to.items(), config.CONFIG.forwards): │ │ 38 │ │ │ src, dest = from_to │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/tgcf/config.py:198 in load_fromto │ │ │ │ 195 │ │ if type(source) != int and source.strip() == "": │ │ 196 │ │ │ continue │ │ 197 │ │ src = await (forward.source) │ │ ❱ 198 │ │ from_todict[src] = [await (dest) for dest in forward.dest] │ │ 199 │ logging.info(f"From to dict is {from_to_dict}") │ │ 200 │ return from_todict │ │ 201 │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/tgcf/config.py:198 in │ │ │ │ 195 │ │ if type(source) != int and source.strip() == "": │ │ 196 │ │ │ continue │ │ 197 │ │ src = await (forward.source) │ │ ❱ 198 │ │ from_todict[src] = [await (dest) for dest in forward.dest] │ │ 199 │ logging.info(f"From to dict is {from_to_dict}") │ │ 200 │ return from_todict │ │ 201 │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/tgcf/config.py:189 in │ │ │ │ 186 │ from_todict = {} │ │ 187 │ │ │ 188 │ async def (peer): │ │ ❱ 189 │ │ return await get_id(client, peer) │ │ 190 │ │ │ 191 │ for forward in forwards: │ │ 192 │ │ if not forward.use_this: │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/tgcf/config.py:164 in get_id │ │ │ │ 161 │ │ 162 │ │ 163 async def get_id(client: TelegramClient, peer): │ │ ❱ 164 │ return await client.get_peer_id(peer) │ │ 165 │ │ 166 │ │ 167 async def load_from_to( │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/telethon/client/users.py:503 in │ │ get_peer_id │ │ │ │ 500 │ │ │ │ # 0x2d45687, 0xc91c90b6 == crc32(b'Peer') and b'InputPeer' │ │ 501 │ │ │ │ peer = await self.get_input_entity(peer) │ │ 502 │ │ except AttributeError: │ │ ❱ 503 │ │ │ peer = await self.get_input_entity(peer) │ │ 504 │ │ │ │ 505 │ │ if isinstance(peer, types.InputPeerSelf): │ │ 506 │ │ │ peer = await self.get_me(input_peer=True) │ │ │ │ /Users/itamartuby/my-tgcf/.venv/lib/python3.11/site-packages/telethon/client/users.py:556 in │ │ _get_entity_from_string │ │ │ │ 553 │ │ │ │ │ result = await self( │ │ 554 │ │ │ │ │ │ functions.contacts.ResolveUsernameRequest(username)) │ │ 555 │ │ │ │ except errors.UsernameNotOccupiedError as e: │ │ ❱ 556 │ │ │ │ │ raise ValueError('No user has "{}" as username' │ │ 557 │ │ │ │ │ │ │ │ │ .format(username)) from e │ │ 558 │ │ │ │ │ │ 559 │ │ │ │ try: │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValueError: No user has "llll413" as username

25gabriel-cmyk commented 1 year ago

Have you try with same username who running TGCF on your system?