mirror of
https://gitflic.ru/project/alt-gnome/karkas.git
synced 2025-09-26 18:29:06 +03:00
написана точка входа бота, конфиг, добавлена зависимость PyYAML
This commit is contained in:
4
src/core/config.py
Normal file
4
src/core/config.py
Normal file
@@ -0,0 +1,4 @@
|
||||
import yaml
|
||||
|
||||
with open('config.yaml', 'r') as file:
|
||||
yaml_load = yaml.full_load(file)
|
2
src/core/config.yaml
Normal file
2
src/core/config.yaml
Normal file
@@ -0,0 +1,2 @@
|
||||
TELEGRAM:
|
||||
TOKEN: xxxxxxxxxxxxxxxxxxxx
|
19
src/core/main.py
Normal file
19
src/core/main.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from .config import yaml_load
|
||||
|
||||
from asyncio import run
|
||||
from aiogram import Bot, Dispatcher
|
||||
|
||||
|
||||
async def main():
|
||||
try:
|
||||
bot = Bot(token=yaml_load["TELEGRAM"]["TOKEN"])
|
||||
dp = Dispatcher()
|
||||
|
||||
await dp.start_polling(bot)
|
||||
|
||||
finally:
|
||||
await bot.session.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run(main())
|
0
src/modules/standart/database/tests/__init__.py
Normal file
0
src/modules/standart/database/tests/__init__.py
Normal file
Reference in New Issue
Block a user