mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Custom filters upd
This commit is contained in:
@@ -5,6 +5,7 @@ import string
|
||||
import threading
|
||||
import traceback
|
||||
from typing import Any, Callable, List, Dict, Optional, Union
|
||||
from abc import ABC
|
||||
|
||||
# noinspection PyPep8Naming
|
||||
import queue as Queue
|
||||
@@ -457,20 +458,20 @@ def webhook_google_functions(bot, request):
|
||||
return 'Bot ON'
|
||||
|
||||
|
||||
class SimpleCustomFilter:
|
||||
class SimpleCustomFilter(ABC):
|
||||
"""
|
||||
Simple Custom Filter base class.
|
||||
Create child class with check() method.
|
||||
Accepts only bool.
|
||||
"""
|
||||
|
||||
def check(message):
|
||||
def check(self, message):
|
||||
"""
|
||||
Perform a check.
|
||||
"""
|
||||
pass
|
||||
|
||||
class AdvancedCustomFilter:
|
||||
class AdvancedCustomFilter(ABC):
|
||||
"""
|
||||
Simple Custom Filter base class.
|
||||
Create child class with check() method.
|
||||
@@ -479,8 +480,8 @@ class AdvancedCustomFilter:
|
||||
text: Filter value given in handler
|
||||
"""
|
||||
|
||||
def check(message, text):
|
||||
def check(self, message, text):
|
||||
"""
|
||||
Perform a check.
|
||||
"""
|
||||
pass
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user