mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1462 from coder2020official/master
Allow using non-class states
This commit is contained in:
commit
01a6827542
@ -278,7 +278,10 @@ class StateFilter(AdvancedCustomFilter):
|
||||
if text == '*': return True
|
||||
|
||||
if isinstance(text, list):
|
||||
new_text = [i.name for i in text]
|
||||
new_text = []
|
||||
for i in text:
|
||||
if isclass(i): i = i.name
|
||||
new_text.append(i)
|
||||
text = new_text
|
||||
elif isinstance(text, object):
|
||||
text = text.name
|
||||
|
@ -282,7 +282,10 @@ class StateFilter(AdvancedCustomFilter):
|
||||
if text == '*': return True
|
||||
|
||||
if isinstance(text, list):
|
||||
new_text = [i.name for i in text]
|
||||
new_text = []
|
||||
for i in text:
|
||||
if isclass(i): i = i.name
|
||||
new_text.append(i)
|
||||
text = new_text
|
||||
elif isinstance(text, object):
|
||||
text = text.name
|
||||
|
Loading…
Reference in New Issue
Block a user