diff --git a/telegram/bot.py b/telegram/bot.py index d64840416..362f2daca 100644 --- a/telegram/bot.py +++ b/telegram/bot.py @@ -1519,6 +1519,10 @@ class Bot(TelegramObject): if (res.input_message_content._has_parse_mode and res.input_message_content.parse_mode is DEFAULT_NONE): res.input_message_content.parse_mode = self.defaults.parse_mode + if (res.input_message_content._has_disable_web_page_preview + and res.input_message_content.disable_web_page_preview is DEFAULT_NONE): + res.input_message_content.disable_web_page_preview = \ + self.defaults.disable_web_page_preview results = [res.to_dict() for res in results] data = {'inline_query_id': inline_query_id, 'results': results} diff --git a/telegram/inline/inputmessagecontent.py b/telegram/inline/inputmessagecontent.py index e1fea9fc1..ee92f6a24 100644 --- a/telegram/inline/inputmessagecontent.py +++ b/telegram/inline/inputmessagecontent.py @@ -32,3 +32,7 @@ class InputMessageContent(TelegramObject): @property def _has_parse_mode(self): return hasattr(self, 'parse_mode') + + @property + def _has_disable_web_page_preview(self): + return hasattr(self, 'disable_web_page_preview') diff --git a/telegram/inline/inputtextmessagecontent.py b/telegram/inline/inputtextmessagecontent.py index de7af87c9..48f85024b 100644 --- a/telegram/inline/inputtextmessagecontent.py +++ b/telegram/inline/inputtextmessagecontent.py @@ -47,7 +47,7 @@ class InputTextMessageContent(InputMessageContent): def __init__(self, message_text, parse_mode=DEFAULT_NONE, - disable_web_page_preview=None, + disable_web_page_preview=DEFAULT_NONE, **kwargs): # Required self.message_text = message_text