mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 18:01:04 +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
|
import asyncio
|
||||||
|
|
||||||
from .bot import Bot
|
from .bot import Bot
|
||||||
|
from .dispatcher import Dispatcher
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import uvloop
|
import uvloop
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
from aiogram.utils import context
|
|
||||||
from .filters import check_filters
|
from .filters import check_filters
|
||||||
|
from ..utils import context
|
||||||
|
|
||||||
|
|
||||||
class SkipHandler(BaseException):
|
class SkipHandler(BaseException):
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ class _MatchErrorMixin:
|
||||||
@classmethod
|
@classmethod
|
||||||
def throw(cls):
|
def throw(cls):
|
||||||
"""
|
"""
|
||||||
Throw a error
|
Throw error
|
||||||
|
|
||||||
:raise: this
|
:raise: this
|
||||||
"""
|
"""
|
||||||
|
|
@ -124,7 +124,6 @@ class BadRequest(TelegramAPIError, _MatchErrorMixin):
|
||||||
|
|
||||||
class MessageError(BadRequest):
|
class MessageError(BadRequest):
|
||||||
__group = True
|
__group = True
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class MessageNotModified(MessageError):
|
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