Skip to content

Commit

Permalink
refactor: code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
OCCASS committed Oct 25, 2022
1 parent 5ac5675 commit d1087e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 146 deletions.
143 changes: 0 additions & 143 deletions aiogram_tests/handler.py

This file was deleted.

7 changes: 4 additions & 3 deletions aiogram_tests/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from aiogram.utils.helper import Item

from .exceptions import MethodIsNotCalledError
from .handler import RequestHandler
from .handler.base import RequestHandler
from .utils import camel_case2snake_case


Expand Down Expand Up @@ -146,13 +146,14 @@ def __getattr__(self, item):
return getattr(self, item)
else:
raise MethodIsNotCalledError(
"method '{}' is not called.\nTry to use: {}".format(item, ", ".join(self._get_attributes()))
"method '%s' is not called by bot, so you cant to get this attribute. Called methods: %s"
% (item, self._get_attributes())
)


class Requester:
def __init__(self, *, request_handler: RequestHandler):
self._handler = request_handler
self._handler: RequestHandler = request_handler

async def query(self, *args, **kwargs) -> Calls:
await self._handler(*args, **kwargs)
Expand Down

0 comments on commit d1087e4

Please sign in to comment.