From 91d0877c61b207180490a54ddd63307ec2c5280b Mon Sep 17 00:00:00 2001 From: _run Date: Mon, 24 Jan 2022 21:28:10 +0400 Subject: [PATCH] Fix parameter name to fit --- examples/asynchronous_telebot/custom_states.py | 3 ++- telebot/async_telebot.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/asynchronous_telebot/custom_states.py b/examples/asynchronous_telebot/custom_states.py index 7658a81..01cc66d 100644 --- a/examples/asynchronous_telebot/custom_states.py +++ b/examples/asynchronous_telebot/custom_states.py @@ -8,7 +8,8 @@ from telebot.asyncio_storage import StateRedisStorage,StateMemoryStorage,StatePi # new feature for states. from telebot.asyncio_handler_backends import State, StatesGroup -bot = AsyncTeleBot('TOKEN') +# default state storage is statememorystorage +bot = AsyncTeleBot('TOKEN', states_storage=StateMemoryStorage()) # Just create different statesgroup diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index a2edafb..7bdb0dc 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -164,7 +164,7 @@ class AsyncTeleBot: """ def __init__(self, token: str, parse_mode: Optional[str]=None, offset=None, - exception_handler=None, states_storage=StateMemoryStorage()) -> None: # TODO: ADD TYPEHINTS + exception_handler=None, state_storage=StateMemoryStorage()) -> None: # TODO: ADD TYPEHINTS self.token = token self.offset = offset @@ -193,7 +193,7 @@ class AsyncTeleBot: self.custom_filters = {} self.state_handlers = [] - self.current_states = states_storage + self.current_states = state_storage self.middlewares = []