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 773 forks source link

Bot Token Not Found #549

Open Valince opened 6 months ago

Valince commented 6 months ago

Followed all instructions, getting Bot token not found and then the app stops.

What am I missing here? Bot token has been added....

tgcf Running latest tgcf version 1.1.8

[12/21/23 10:03:17] INFO Verbosity turned on! This is suitable for debugging cli.py:57 INFO cryptg detected, it will be used for encryption aes.py:19 [12/21/23 10:03:18] INFO tgcf.config.json detected! config.py:109 INFO config.py got executed config.py:259 INFO using bot account config.py:215 INFO Connecting to 149.154.167.51:443/TcpFull... mtprotosender.py:226 [12/21/23 10:03:20] INFO Connection to 149.154.167.51:443/TcpFull complete! mtprotosender.py:277 ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /home/mint/my-tgcf/.venv/lib/python3.10/site-packages/tgcf/cli.py:120 in main │ │ │ │ 117 │ else: │ │ 118 │ │ from tgcf.live import start_sync # pylint: disable=import-outside-toplevel │ │ 119 │ │ │ │ ❱ 120 │ │ asyncio.run(start_sync()) │ │ 121 │ │ 122 │ │ 123 # AAHNIK 2021 │ │ │ │ /usr/lib/python3.10/asyncio/runners.py:44 in run │ │ │ │ 41 │ │ events.set_event_loop(loop) │ │ 42 │ │ if debug is not None: │ │ 43 │ │ │ loop.set_debug(debug) │ │ ❱ 44 │ │ return loop.run_until_complete(main) │ │ 45 │ finally: │ │ 46 │ │ try: │ │ 47 │ │ │ _cancel_all_tasks(loop) │ │ │ │ /usr/lib/python3.10/asyncio/base_events.py:649 in run_until_complete │ │ │ │ 646 │ │ if not future.done(): │ │ 647 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │ │ 648 │ │ │ │ ❱ 649 │ │ return future.result() │ │ 650 │ │ │ 651 │ def stop(self): │ │ 652 │ │ """Stop running the event loop. │ │ │ │ /home/mint/my-tgcf/.venv/lib/python3.10/site-packages/tgcf/live.py:133 in start_sync │ │ │ │ 130 │ │ if CONFIG.login.BOT_TOKEN == "": │ │ 131 │ │ │ logging.warning("Bot token not found, but login type is set to bot.") │ │ 132 │ │ │ sys.exit() │ │ ❱ 133 │ │ await client.start(bot_token=CONFIG.login.BOT_TOKEN) │ │ 134 │ else: │ │ 135 │ │ await client.start() │ │ 136 │ config.is_bot = await client.is_bot() │ │ │ │ /home/mint/my-tgcf/.venv/lib/python3.10/site-packages/telethon/client/auth.py:183 in _start │ │ │ │ 180 │ │ │ │ phone = utils.parse_phone(value) or phone │ │ 181 │ │ │ │ 182 │ │ if bot_token: │ │ ❱ 183 │ │ │ await self.sign_in(bot_token=bot_token) │ │ 184 │ │ │ return self │ │ 185 │ │ │ │ 186 │ │ me = None │ │ │ │ /home/mint/my-tgcf/.venv/lib/python3.10/site-packages/telethon/client/auth.py:369 in sign_in │ │ │ │ 366 │ │ │ │ 'and a password only if an RPCError was raised before.' │ │ 367 │ │ │ ) │ │ 368 │ │ │ │ ❱ 369 │ │ result = await self(request) │ │ 370 │ │ if isinstance(result, types.auth.AuthorizationSignUpRequired): │ │ 371 │ │ │ # Emulate pre-layer 104 behaviour │ │ 372 │ │ │ self._tos = result.terms_of_service │ │ │ │ /home/mint/my-tgcf/.venv/lib/python3.10/site-packages/telethon/client/users.py:30 in call │ │ │ │ 27 │ │ 28 class UserMethods: │ │ 29 │ async def call(self: 'TelegramClient', request, ordered=False, flood_sleep_thres │ │ ❱ 30 │ │ return await self._call(self._sender, request, ordered=ordered) │ │ 31 │ │ │ 32 │ async def _call(self: 'TelegramClient', sender, request, ordered=False, floodsleep │ │ 33 │ │ if flood_sleep_threshold is None: │ │ │ │ /home/mint/my-tgcf/.venv/lib/python3.10/site-packages/telethon/client/users.py:84 in _call │ │ │ │ 81 │ │ │ │ │ else: │ │ 82 │ │ │ │ │ │ return results │ │ 83 │ │ │ │ else: │ │ ❱ 84 │ │ │ │ │ result = await future │ │ 85 │ │ │ │ │ self.session.process_entities(result) │ │ 86 │ │ │ │ │ self._entity_cache.add(result) │ │ 87 │ │ │ │ │ return result │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ApiIdInvalidError: The api_id/api_hash combination is invalid (caused by ImportBotAuthorizationRequest)

AasishSapkota commented 5 months ago

sometimes just refreshing it and entering the bot token and then click save 2-3 times will solve this problem . i was also facing the same problem.

let me if it helped you or not.