1
0
mirror of https://github.com/ijaric/voice_assistant.git synced 2025-12-19 01:36:18 +00:00

feat: [#49] tg_bot

This commit is contained in:
2023-10-13 23:07:42 +03:00
parent 8486d2e0bf
commit 0410c0d341
23 changed files with 1784 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
from .environment import *
__all__ = [
"EnvironmentMiddleware",
]

View File

@@ -0,0 +1,14 @@
import typing
import aiogram.dispatcher.middlewares as dispatcher_middlewares
class EnvironmentMiddleware(dispatcher_middlewares.LifetimeControllerMiddleware):
skip_patterns = ["error", "update"]
def __init__(self, **kwargs: typing.Any):
super().__init__()
self.kwargs = kwargs
async def pre_process(self, obj: typing.Any, data: dict[typing.Any, typing.Any], *args: typing.Any):
data.update(**self.kwargs)