Загрузка...

Problem with the Python code for TG bot, how to fix it?

Thread in Python created by Trodix Apr 22, 2025. 174 views

  1. Trodix
    Trodix Topic starter Apr 22, 2025 0 Oct 14, 2024
    Нажимаю кнопку и выскакивает такая проблема.


    Python
    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File "C:\Users\P2P\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\P2P\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 235, in process_updates
    return await asyncio.gather(*tasks)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\P2P\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\P2P\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiogram\dispatcher\dispatcher.py", line 256, in process_update
    return await self.message_handlers.notify(update.message)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\P2P\AppData\Local\Programs\Python\Python311\Lib\site-packages\aiogram\dispatcher\handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\P2P\Downloads\Sn0sing\snosernewbot.py", line 767, in process_sent_message
    await send_message_to_users(text)
    File "C:\Users\P2P\Downloads\Sn0sing\snosernewbot.py", line 754, in send_message_to_users
    except aiogram.utils.exceptions.BotBlocked as e:
    ^^^^^^^
    NameError: name 'aiogram' is not defined
     
    1. George_a_fish
      Trodix, [IMG]у тебя переменная aiogram не сущетсвует, напиши в начале файла: import aiogram
  2. RyanGosling
    RyanGosling Apr 22, 2025 11 May 14, 2019
    в cmd - pip install aiogram
    если работаешь в пичарме - win+f12, и пишешь туда тоже самое
     
    1. RyanGosling
      RyanGosling, а рил импорт вписать надо было сорри я ваще еблан
  3. hetlainov
    hetlainov Apr 22, 2025 10 Mar 9, 2019
    У тебя библиотека то в коде определена?
     
  4. maca
    Библиотеку импортируй и всё
     
  5. Ukral
    import aiogram
     
Top
Loading...