-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
29 lines (24 loc) · 757 Bytes
/
Copy pathindex.py
File metadata and controls
29 lines (24 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import json
from aiogram import (Bot, Dispatcher)
from aiogram.enums import ParseMode
from aiogram.client.default import DefaultBotProperties
from routers import router as main_router
from core.config import settings
bot = Bot(
token=settings.BOT_TOKEN,
default=DefaultBotProperties(parse_mode=ParseMode.HTML),
)
dp = Dispatcher()
dp.include_router(main_router)
async def handler(event, context):
"""
Entry point
Точка входа в функцию
(index.handler)
"""
#request_body_dict = json.loads(event['body'])
request_body_dict = json.loads(event["messages"][0]["details"]["message"]["body"])
await dp.feed_webhook_update(bot=bot, update=request_body_dict)
return {
'statusCode': 200
}