1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fix typehint for ``set_state``

This commit is contained in:
_run 2022-06-30 17:06:39 +05:00
parent c36f3a228e
commit 419bc5878f
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ logger.addHandler(console_output_handler)
logger.setLevel(logging.ERROR) logger.setLevel(logging.ERROR)
from telebot import apihelper, util, types from telebot import apihelper, util, types
from telebot.handler_backends import MemoryHandlerBackend, FileHandlerBackend, BaseMiddleware, CancelUpdate, SkipHandler from telebot.handler_backends import MemoryHandlerBackend, FileHandlerBackend, BaseMiddleware, CancelUpdate, SkipHandler, State
from telebot.custom_filters import SimpleCustomFilter, AdvancedCustomFilter from telebot.custom_filters import SimpleCustomFilter, AdvancedCustomFilter
@ -2927,7 +2927,7 @@ class TeleBot:
def set_state(self, user_id: int, state: Union[int, str], chat_id: int=None) -> None: def set_state(self, user_id: int, state: Union[int, str, State], chat_id: int=None) -> None:
""" """
Sets a new state of a user. Sets a new state of a user.

View File

@ -14,7 +14,7 @@ import telebot.types
# storages # storages
from telebot.asyncio_storage import StateMemoryStorage, StatePickleStorage from telebot.asyncio_storage import StateMemoryStorage, StatePickleStorage
from telebot.asyncio_handler_backends import CancelUpdate, SkipHandler from telebot.asyncio_handler_backends import CancelUpdate, SkipHandler, State
from inspect import signature from inspect import signature
@ -3455,7 +3455,7 @@ class AsyncTeleBot:
return await asyncio_helper.delete_sticker_from_set(self.token, sticker) return await asyncio_helper.delete_sticker_from_set(self.token, sticker)
async def set_state(self, user_id: int, state: str, chat_id: int=None): async def set_state(self, user_id: int, state: Union[State, int, str], chat_id: int=None):
""" """
Sets a new state of a user. Sets a new state of a user.