From dde9cd323cae35d8091acf947e3ee0b20d41fd9b Mon Sep 17 00:00:00 2001 From: _run Date: Fri, 25 Feb 2022 19:45:52 +0500 Subject: [PATCH 1/4] Update asyncio_filters.py --- telebot/asyncio_filters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telebot/asyncio_filters.py b/telebot/asyncio_filters.py index 6c1fc4b..ec0baad 100644 --- a/telebot/asyncio_filters.py +++ b/telebot/asyncio_filters.py @@ -1,5 +1,6 @@ from abc import ABC from typing import Optional, Union +from telebot.asyncio_handler_backends import State from telebot import types @@ -280,10 +281,10 @@ class StateFilter(AdvancedCustomFilter): if isinstance(text, list): new_text = [] for i in text: - if isclass(i): i = i.name + if isinstance(text, State): i = i.name new_text.append(i) text = new_text - elif isinstance(text, object): + elif isinstance(text, State): text = text.name if message.chat.type == 'group': From 70b9fc86d24356e649b6d07835bf00ef3f77ad4d Mon Sep 17 00:00:00 2001 From: _run Date: Fri, 25 Feb 2022 19:46:49 +0500 Subject: [PATCH 2/4] Update custom_filters.py --- telebot/custom_filters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/telebot/custom_filters.py b/telebot/custom_filters.py index 0305673..70bf8ed 100644 --- a/telebot/custom_filters.py +++ b/telebot/custom_filters.py @@ -1,5 +1,6 @@ from abc import ABC from typing import Optional, Union +from telebot.handler_backends import State from telebot import types @@ -284,10 +285,10 @@ class StateFilter(AdvancedCustomFilter): if isinstance(text, list): new_text = [] for i in text: - if isclass(i): i = i.name + if isinstance(text, State): i = i.name new_text.append(i) text = new_text - elif isinstance(text, object): + elif isinstance(text, State): text = text.name if message.chat.type == 'group': group_state = self.bot.current_states.get_state(message.chat.id, message.from_user.id) From 75baf6dd96eb9bd3e6366f195e7b7cd0ed3d0975 Mon Sep 17 00:00:00 2001 From: _run Date: Fri, 25 Feb 2022 19:52:56 +0500 Subject: [PATCH 3/4] Update custom_filters.py --- telebot/custom_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/custom_filters.py b/telebot/custom_filters.py index 70bf8ed..6d69865 100644 --- a/telebot/custom_filters.py +++ b/telebot/custom_filters.py @@ -285,7 +285,7 @@ class StateFilter(AdvancedCustomFilter): if isinstance(text, list): new_text = [] for i in text: - if isinstance(text, State): i = i.name + if isinstance(i, State): i = i.name new_text.append(i) text = new_text elif isinstance(text, State): From f4c76553ed9770cf010faaf680bb7eee128fda76 Mon Sep 17 00:00:00 2001 From: _run Date: Fri, 25 Feb 2022 19:53:17 +0500 Subject: [PATCH 4/4] Update asyncio_filters.py --- telebot/asyncio_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telebot/asyncio_filters.py b/telebot/asyncio_filters.py index ec0baad..037ec9d 100644 --- a/telebot/asyncio_filters.py +++ b/telebot/asyncio_filters.py @@ -281,7 +281,7 @@ class StateFilter(AdvancedCustomFilter): if isinstance(text, list): new_text = [] for i in text: - if isinstance(text, State): i = i.name + if isinstance(i, State): i = i.name new_text.append(i) text = new_text elif isinstance(text, State):