X Tutup
Skip to content

Commit 9a340d2

Browse files
committed
Endorsing if empty or 0 or empty string and minor typo fix python-telegram-bot#232
1 parent a98919a commit 9a340d2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

telegram/bot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ def sendChatAction(self,
747747
def answerInlineQuery(self,
748748
inline_query_id,
749749
results,
750-
cache_time=None,
750+
cache_time=300,
751751
is_personal=None,
752752
next_offset=None,
753753
switch_pm_text=None,
@@ -801,7 +801,7 @@ def answerInlineQuery(self,
801801
data['cache_time'] = int(cache_time)
802802
if is_personal:
803803
data['is_personal'] = bool(is_personal)
804-
if next_offset:
804+
if next_offset or next_offset == '':
805805
data['next_offset'] = next_offset
806806
if switch_pm_text:
807807
data['switch_pm_text'] = switch_pm_text
@@ -935,7 +935,7 @@ def unbanChatMember(self,
935935
def answerCallbackQuery(self,
936936
callback_query_id,
937937
text=None,
938-
show_alert=None):
938+
show_alert=False):
939939
"""Use this method to send answers to callback queries sent from inline
940940
keyboards. The answer will be displayed to the user as a notification
941941
at the top of the chat screen or as an alert.
@@ -1161,7 +1161,7 @@ def getUpdates(self,
11611161
data['offset'] = offset
11621162
if limit:
11631163
data['limit'] = limit
1164-
if timeout:
1164+
if timeout or timeout == 0:
11651165
data['timeout'] = timeout
11661166

11671167
result = request.post(url, data, network_delay=network_delay)
@@ -1195,7 +1195,7 @@ def setWebhook(self,
11951195
url = '%s/setWebhook' % self.base_url
11961196

11971197
data = {}
1198-
if webhook_url:
1198+
if webhook_url or webhook_url == '':
11991199
data['url'] = webhook_url
12001200
if certificate:
12011201
data['certificate'] = certificate

telegram/utils/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def download(url,
183183
The web location we want to retrieve.
184184
185185
filename:
186-
The filename wihtin the path to download the file.
186+
The filename within the path to download the file.
187187
"""
188188

189189
urlretrieve(url, filename)

0 commit comments

Comments
 (0)
X Tutup