Добавлена базовая структура проекта 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
+1
View File
@@ -0,0 +1 @@
BOT_TOKEN=8918896220:AAHuo36Lo9PEeXVNongKJbr2WLZn5xxy1GQ
+5
View File
@@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.14 (PythonProject) (2)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
+13
View File
@@ -0,0 +1,13 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<list>
<option value="aiogram" />
<option value="python-dotenv" />
</list>
</option>
</inspection_tool>
</profile>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.14 (PythonProject) (2)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.14 (PythonProject) (2)" project-jdk-type="Python SDK" />
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/PythonProject.iml" filepath="$PROJECT_DIR$/.idea/PythonProject.iml" />
</modules>
</component>
</project>
Generated
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+9
View File
@@ -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 не найден")
+1
View File
@@ -0,0 +1 @@
BOOKINGS = {}
+8
View File
@@ -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("👋 Бот запущен (чистый старт)")
View File
View File
+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. from aiogram import Bot, Dispatcher
# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. 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): async def main():
# Use a breakpoint in the code line below to debug your script. bot = Bot(token=BOT_TOKEN)
print(f'Hi, {name}') # Press ⌘F8 to toggle the breakpoint. 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__":
if __name__ == '__main__': asyncio.run(main())
print_hi('PyCharm')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
+2
View File
@@ -0,0 +1,2 @@
aiogram
python-dotenv