Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class State(MessageFilter):
- data_filter = True
- def __init__(self, required_state):
- self.required_state = required_state
- def get_user_state(self, message):
- user_id = message.chat_id
- user = User(user_id)
- state = user.get_state()
- self.user = user
- self.state = state
- def filter(self, message):
- self.get_user_state(message)
- if self.state == self.required_state:
- context_attributes = {
- "user": [self.user],
- "state": [self.state]
- }
- return context_attributes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement