diff --git a/.env b/.env new file mode 100644 index 0000000..bde5482 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +BOT_TOKEN=8918896220:AAHuo36Lo9PEeXVNongKJbr2WLZn5xxy1GQ \ No newline at end of file diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/PythonProject.iml b/.idea/PythonProject.iml new file mode 100644 index 0000000..157f929 --- /dev/null +++ b/.idea/PythonProject.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..1b93a53 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..c7ae335 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..5f43230 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/config.py b/app/config.py new file mode 100644 index 0000000..27036cd --- /dev/null +++ b/app/config.py @@ -0,0 +1,9 @@ +import os +from dotenv import load_dotenv + +load_dotenv() + +BOT_TOKEN = os.getenv("BOT_TOKEN") + +if not BOT_TOKEN: + raise ValueError("BOT_TOKEN не найден") \ No newline at end of file diff --git a/app/db/memory.py b/app/db/memory.py new file mode 100644 index 0000000..34c0968 --- /dev/null +++ b/app/db/memory.py @@ -0,0 +1 @@ +BOOKINGS = {} \ No newline at end of file diff --git a/app/handlers/start.py b/app/handlers/start.py new file mode 100644 index 0000000..8e5223d --- /dev/null +++ b/app/handlers/start.py @@ -0,0 +1,8 @@ +from aiogram import Router, F +from aiogram.types import Message + +router = Router() + +@router.message(F.text == "/start") +async def start(message: Message): + await message.answer("👋 Бот запущен (чистый старт)") \ No newline at end of file diff --git a/app/keyboards/menu.py b/app/keyboards/menu.py new file mode 100644 index 0000000..e69de29 diff --git a/app/states/booking.py b/app/states/booking.py new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py index 94e3a87..b965ac6 100644 --- a/main.py +++ b/main.py @@ -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()) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0e6b280 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +aiogram +python-dotenv \ No newline at end of file