1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Compare commits

..

No commits in common. "5ca92ff63717984ad008f59043bec5f5829935d4" and "01a6827542ed3a28138ee6618e0ff754a0c3f614" have entirely different histories.

2 changed files with 4 additions and 6 deletions

View File

@ -1,6 +1,5 @@
from abc import ABC
from typing import Optional, Union
from telebot.asyncio_handler_backends import State
from telebot import types
@ -281,10 +280,10 @@ class StateFilter(AdvancedCustomFilter):
if isinstance(text, list):
new_text = []
for i in text:
if isinstance(i, State): i = i.name
if isclass(i): i = i.name
new_text.append(i)
text = new_text
elif isinstance(text, State):
elif isinstance(text, object):
text = text.name
if message.chat.type == 'group':

View File

@ -1,6 +1,5 @@
from abc import ABC
from typing import Optional, Union
from telebot.handler_backends import State
from telebot import types
@ -285,10 +284,10 @@ class StateFilter(AdvancedCustomFilter):
if isinstance(text, list):
new_text = []
for i in text:
if isinstance(i, State): i = i.name
if isclass(i): i = i.name
new_text.append(i)
text = new_text
elif isinstance(text, State):
elif isinstance(text, object):
text = text.name
if message.chat.type == 'group':
group_state = self.bot.current_states.get_state(message.chat.id, message.from_user.id)