Добавлена базовая структура проекта Telegram-бота (handlers, config, memory)

This commit is contained in:
grigorij
2026-06-10 22:51:56 +04:00
parent 1196a8a795
commit 2c6f82bfb5
15 changed files with 94 additions and 11 deletions
+18 -11
View File
@@ -1,16 +1,23 @@
# This is a sample Python script.
import asyncio
import logging
# Press ⌃R to execute it or replace it with your code.
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings.
from aiogram import Bot, Dispatcher
from aiogram.fsm.storage.memory import MemoryStorage
from app.config import BOT_TOKEN
from app.handlers import start
logging.basicConfig(level=logging.INFO)
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint.
async def main():
bot = Bot(token=BOT_TOKEN)
dp = Dispatcher(storage=MemoryStorage())
dp.include_router(start.router)
await dp.start_polling(bot)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
print_hi('PyCharm')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
if __name__ == "__main__":
asyncio.run(main())