From 71d3ec8b4207a08b2fcf1d6e8bca5e7c67bab9a6 Mon Sep 17 00:00:00 2001 From: _run Date: Tue, 6 Sep 2022 18:11:40 +0400 Subject: [PATCH 1/2] Changed user id and chat id --- telebot/custom_filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/custom_filters.py b/telebot/custom_filters.py index dd6a27f..e924f13 100644 --- a/telebot/custom_filters.py +++ b/telebot/custom_filters.py @@ -428,7 +428,7 @@ class StateFilter(AdvancedCustomFilter): text = text.name if message.chat.type in ['group', 'supergroup']: - group_state = self.bot.current_states.get_state(user_id, chat_id) + group_state = self.bot.current_states.get_state(chat_id, user_id) if group_state == text: return True elif type(text) is list and group_state in text: @@ -436,7 +436,7 @@ class StateFilter(AdvancedCustomFilter): else: - user_state = self.bot.current_states.get_state(user_id, chat_id) + user_state = self.bot.current_states.get_state(chat_id, user_id) if user_state == text: return True elif type(text) is list and user_state in text: From e3a4fdff9a9d19db30840e7bd4ef1c3d10a3b623 Mon Sep 17 00:00:00 2001 From: _run Date: Tue, 6 Sep 2022 18:12:11 +0400 Subject: [PATCH 2/2] Update asyncio_filters.py --- telebot/asyncio_filters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telebot/asyncio_filters.py b/telebot/asyncio_filters.py index f138455..72695e9 100644 --- a/telebot/asyncio_filters.py +++ b/telebot/asyncio_filters.py @@ -420,7 +420,7 @@ class StateFilter(AdvancedCustomFilter): text = text.name if message.chat.type in ['group', 'supergroup']: - group_state = await self.bot.current_states.get_state(user_id, chat_id) + group_state = await self.bot.current_states.get_state(chat_id, user_id) if group_state == text: return True elif type(text) is list and group_state in text: @@ -428,7 +428,7 @@ class StateFilter(AdvancedCustomFilter): else: - user_state = await self.bot.current_states.get_state(user_id, chat_id) + user_state = await self.bot.current_states.get_state(chat_id, user_id) if user_state == text: return True elif type(text) is list and user_state in text: