Skip to content

Instantly share code, notes, and snippets.

View arturboyun's full-sized avatar
🐍
Python Backend Developer

Artur arturboyun

🐍
Python Backend Developer
View GitHub Profile
INFO:aiogram.event:Update id=41271717 is not handled. Duration 13 ms by bot id=7379672191
ERROR:aiogram.event:Cause exception while process update id=41271717 by bot id=7379672191
TypeError: command_start_handler() missing 1 required positional argument: 'dialog_manager'
Traceback (most recent call last):
File "/Users/nehz/code/AppsManagerBot/.venv/lib/python3.12/site-packages/aiogram/dispatcher/dispatcher.py", line 309, in _process_update
response = await self.feed_update(bot, update, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nehz/code/AppsManagerBot/.venv/lib/python3.12/site-packages/aiogram/dispatcher/dispatcher.py", line 158, in feed_update
response = await self.update.wrap_outer_middleware(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@arturboyun
arturboyun / ex.py
Last active November 26, 2024 17:13
ex
# commands.py
...
commands_router = Router()
@commands_router.message(CommandStart())
@inject
async def command_start_handler(
message: Message,
dialog_manager: DialogManager,
@arturboyun
arturboyun / base.py
Created October 2, 2024 08:41
Base Class for SQLAlchemy Models
import datetime
import re
import uuid
from sqlalchemy import MetaData, func, DateTime, UUID, text
from sqlalchemy.ext.asyncio import AsyncAttrs
from sqlalchemy.orm import declarative_base, Mapped, mapped_column
POSTGRES_INDEXES_NAMING_CONVENTION = {
"ix": "%(column_0_label)s_idx",
try:
if not pIface.IsPrivateKeyReaded():
pIface.ReadPrivateKeyFile(b"Key-6.dat", b"12345677", None)
except Exception as e:
dError = eval(str(e))
print(
"Key reading failed. Error code: " + str(dError['ErrorCode']) + ". Description: " + dError['ErrorDesc'].decode(
"utf-8"))
pIface.Finalize()
EUUnload()
from aiogram.types import Update
from fastapi import APIRouter
from app.bot.bot import dp
from app.config import config
router = APIRouter()
def get_dispatcher():