mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-10 17:53:17 +00:00
Cleanup
This commit is contained in:
parent
b597f1e565
commit
60bf8aa0dd
4 changed files with 3 additions and 19 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
|
||||
from .bot import Bot
|
||||
from .dispatcher import Dispatcher
|
||||
|
||||
try:
|
||||
import uvloop
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from aiogram.utils import context
|
||||
from .filters import check_filters
|
||||
from ..utils import context
|
||||
|
||||
|
||||
class SkipHandler(BaseException):
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class _MatchErrorMixin:
|
|||
@classmethod
|
||||
def throw(cls):
|
||||
"""
|
||||
Throw a error
|
||||
Throw error
|
||||
|
||||
:raise: this
|
||||
"""
|
||||
|
|
@ -124,7 +124,6 @@ class BadRequest(TelegramAPIError, _MatchErrorMixin):
|
|||
|
||||
class MessageError(BadRequest):
|
||||
__group = True
|
||||
pass
|
||||
|
||||
|
||||
class MessageNotModified(MessageError):
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
import typing
|
||||
|
||||
|
||||
async def safe(coro: typing.Coroutine) -> (bool, typing.Any):
|
||||
"""
|
||||
Safety execute coroutine
|
||||
|
||||
Status - returns True if success otherwise False
|
||||
|
||||
:param coro:
|
||||
:return: status and result
|
||||
"""
|
||||
try:
|
||||
return True, await coro
|
||||
except Exception as e:
|
||||
return False, e
|
||||
Loading…
Add table
Add a link
Reference in a new issue