mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Update asyncio_filters.py
This commit is contained in:
parent
b960a9e574
commit
dde9cd323c
@ -1,5 +1,6 @@
|
|||||||
from abc import ABC
|
from abc import ABC
|
||||||
from typing import Optional, Union
|
from typing import Optional, Union
|
||||||
|
from telebot.asyncio_handler_backends import State
|
||||||
|
|
||||||
from telebot import types
|
from telebot import types
|
||||||
|
|
||||||
@ -280,10 +281,10 @@ class StateFilter(AdvancedCustomFilter):
|
|||||||
if isinstance(text, list):
|
if isinstance(text, list):
|
||||||
new_text = []
|
new_text = []
|
||||||
for i in text:
|
for i in text:
|
||||||
if isclass(i): i = i.name
|
if isinstance(text, State): i = i.name
|
||||||
new_text.append(i)
|
new_text.append(i)
|
||||||
text = new_text
|
text = new_text
|
||||||
elif isinstance(text, object):
|
elif isinstance(text, State):
|
||||||
text = text.name
|
text = text.name
|
||||||
|
|
||||||
if message.chat.type == 'group':
|
if message.chat.type == 'group':
|
||||||
|
Loading…
Reference in New Issue
Block a user