Fix click timeout error is now different

This commit is contained in:
Lonami Exo 2020-07-04 12:30:15 +02:00
parent ab594ed0cb
commit 7b852206f1
4 changed files with 6 additions and 5 deletions

View File

@ -844,7 +844,7 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
data=data
)
)
except errors.BotTimeout:
except errors.BotResponseTimeoutError:
return None
if sum(int(x is not None) for x in (i, text, filter)) >= 2:

View File

@ -1,5 +1,5 @@
from .. import types, functions
from ...errors import BotTimeout
from ...errors import BotResponseTimeoutError
import webbrowser
@ -85,7 +85,7 @@ class MessageButton:
)
try:
return await self._client(req)
except BotTimeout:
except BotResponseTimeoutError:
return None
elif isinstance(self.button, types.KeyboardButtonSwitchInline):
return await self._client(functions.messages.StartBotRequest(
@ -99,5 +99,5 @@ class MessageButton:
)
try:
return await self._client(req)
except BotTimeout:
except BotResponseTimeoutError:
return None

View File

@ -29,6 +29,7 @@ BOT_METHOD_INVALID,400,The API access for bot users is restricted. The method yo
BOT_MISSING,400,This method can only be run by a bot
BOT_PAYMENTS_DISABLED,400,This method can only be run by a bot
BOT_POLLS_DISABLED,400,You cannot create polls under a bot account
BOT_RESPONSE_TIMEOUT,400,The bot did not answer to the callback query in time
BROADCAST_ID_INVALID,400,The channel is invalid
BROADCAST_PUBLIC_VOTERS_FORBIDDEN,400,You cannot broadcast polls where the voters are public
BUTTON_DATA_INVALID,400,The provided button data is invalid

1 name codes description
29 BOT_MISSING 400 This method can only be run by a bot
30 BOT_PAYMENTS_DISABLED 400 This method can only be run by a bot
31 BOT_POLLS_DISABLED 400 You cannot create polls under a bot account
32 BOT_RESPONSE_TIMEOUT 400 The bot did not answer to the callback query in time
33 BROADCAST_ID_INVALID 400 The channel is invalid
34 BROADCAST_PUBLIC_VOTERS_FORBIDDEN 400 You cannot broadcast polls where the voters are public
35 BUTTON_DATA_INVALID 400 The provided button data is invalid

View File

@ -199,7 +199,7 @@ messages.getAllDrafts,user,
messages.getAllStickers,user,
messages.getArchivedStickers,user,
messages.getAttachedStickers,user,
messages.getBotCallbackAnswer,user,CHANNEL_INVALID DATA_INVALID MESSAGE_ID_INVALID PEER_ID_INVALID Timeout
messages.getBotCallbackAnswer,user,BOT_RESPONSE_TIMEOUT CHANNEL_INVALID DATA_INVALID MESSAGE_ID_INVALID PEER_ID_INVALID Timeout
messages.getChats,both,CHAT_ID_INVALID PEER_ID_INVALID
messages.getCommonChats,user,USER_ID_INVALID
messages.getDhConfig,user,RANDOM_LENGTH_INVALID

1 method usability errors
199 messages.getAllStickers user
200 messages.getArchivedStickers user
201 messages.getAttachedStickers user
202 messages.getBotCallbackAnswer user CHANNEL_INVALID DATA_INVALID MESSAGE_ID_INVALID PEER_ID_INVALID Timeout BOT_RESPONSE_TIMEOUT CHANNEL_INVALID DATA_INVALID MESSAGE_ID_INVALID PEER_ID_INVALID Timeout
203 messages.getChats both CHAT_ID_INVALID PEER_ID_INVALID
204 messages.getCommonChats user USER_ID_INVALID
205 messages.getDhConfig user RANDOM_LENGTH_INVALID