Skip to content

Commit defa9bf

Browse files
Accounts deleted by inactivity incorrectly raised an APIError
For a long time trying to write to a user deleted by inactivity incorrectly raised an APIError instead of a ChatUnavailableError
1 parent c55fe3f commit defa9bf

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

botogram/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def call(self, method, params=None, files=None, expect=None):
127127
reason = "blocked"
128128

129129
# This happens when the user deleted its account
130-
elif status == 403 and "deleted" in message:
130+
elif status == 403 and "deactivated" in message:
131131
# Error code # 403
132-
# Forbidden: user is deleted
132+
# Forbidden: user is deactivated
133133
reason = "account_deleted"
134134

135135
# This happens, as @BotSupport says, when the Telegram API

docs/changelog/0.4.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@ Changelog of botogram 0.4.x
77

88
Here you can find all the changes in the botogram 0.4.x releases.
99

10+
.. _changelog-0.4.1:
11+
12+
botogram 0.4.1
13+
==============
14+
15+
*Alpha release, not yet released.*
16+
17+
Release description not yet written.
18+
19+
Bug fixes
20+
---------
21+
22+
* Accounts deleted by inactivity incorrectly raised an APIError instead of a ChatUnavailableError
23+
1024
.. _changelog-0.4:
1125

1226
botogram 0.4

tests/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_unavailable_chats(api, mock_req):
8080
},
8181
"sendVoice": {
8282
"ok": False, "error_code": 403,
83-
"description": "Forbidden: user is deleted",
83+
"description": "Forbidden: user is deactivated",
8484
},
8585
"sendChatAction": {
8686
"ok": False, "error_code": 400,

0 commit comments

Comments
 (0)