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

Compare commits

...

6 Commits

Author SHA1 Message Date
Badiboy
49c93b6027
Merge pull request #1598 from coder2020official/master
Fix typehint for set_state
2022-06-30 15:32:30 +03:00
_run
36749cbdd9
Merge branch 'eternnoir:master' into master 2022-06-30 17:10:25 +05:00
_run
6d12b1f2a7
Update callback_data.py 2022-06-30 17:10:14 +05:00
_run
419bc5878f Fix typehint for ``set_state`` 2022-06-30 17:06:39 +05:00
_run
c36f3a228e Update callback_data.py 2022-06-29 21:17:57 +05:00
_run
ca525b5bea Copyright changes 2022-06-29 21:06:36 +05:00
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ logger.addHandler(console_output_handler)
logger.setLevel(logging.ERROR)
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
@ -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.

View File

@ -14,7 +14,7 @@ import telebot.types
# storages
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
@ -3455,7 +3455,7 @@ class AsyncTeleBot:
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.