From 28662876a22e813c608acebf258db2051d9cef6d Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sat, 21 May 2022 17:09:59 +0500 Subject: [PATCH 1/4] Add workspace exception in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2586c71..fa4a91e 100644 --- a/.gitignore +++ b/.gitignore @@ -64,6 +64,7 @@ testMain.py #VS Code .vscode/ .DS_Store +*.code-workspace # documentation _build/ From 33375ac135c41d1e1cd03df2ec84e55155f2a569 Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sat, 21 May 2022 17:10:29 +0500 Subject: [PATCH 2/4] Added ability to set default parse_mode for explanation_parse_mode in send_poll --- telebot/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telebot/__init__.py b/telebot/__init__.py index 09b3002..abadfe5 100644 --- a/telebot/__init__.py +++ b/telebot/__init__.py @@ -2510,6 +2510,8 @@ class TeleBot: if isinstance(question, types.Poll): raise RuntimeError("The send_poll signature was changed, please see send_poll function details.") + explanation_parse_mode = self.parse_mode if (explanation_parse_mode is None) else explanation_parse_mode + return types.Message.de_json( apihelper.send_poll( self.token, chat_id, From d954f8f5b33c71d184c25670ccc4e5b385933d76 Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sat, 21 May 2022 17:10:45 +0500 Subject: [PATCH 3/4] Fixed default parse mode in asynctelebot --- telebot/async_telebot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/telebot/async_telebot.py b/telebot/async_telebot.py index 35c2da8..e2df525 100644 --- a/telebot/async_telebot.py +++ b/telebot/async_telebot.py @@ -1674,6 +1674,8 @@ class AsyncTeleBot: :param protect_content: :return: API reply. """ + parse_mode = self.parse_mode if (parse_mode is None) else parse_mode + return types.MessageID.de_json( await asyncio_helper.copy_message(self.token, chat_id, from_chat_id, message_id, caption, parse_mode, caption_entities, disable_notification, reply_to_message_id, allow_sending_without_reply, reply_markup, @@ -3112,6 +3114,8 @@ class AsyncTeleBot: if isinstance(question, types.Poll): raise RuntimeError("The send_poll signature was changed, please see send_poll function details.") + explanation_parse_mode = self.parse_mode if (explanation_parse_mode is None) else explanation_parse_mode + return types.Message.de_json( await asyncio_helper.send_poll( self.token, chat_id, From d6e93f85f1a29ba27e395becf7653b9ea5168dfb Mon Sep 17 00:00:00 2001 From: coder2020official Date: Sat, 21 May 2022 17:10:57 +0500 Subject: [PATCH 4/4] Improved the comment for quick_markup --- telebot/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/telebot/util.py b/telebot/util.py index f116d9e..31522e5 100644 --- a/telebot/util.py +++ b/telebot/util.py @@ -370,7 +370,8 @@ def quick_markup(values: Dict[str, Dict[str, Any]], row_width: int=2) -> types.I 'switch_inline_query_current_chat': None, 'callback_game': None, 'pay': None, - 'login_url': None + 'login_url': None, + 'web_app': None } :param values: a dict containing all buttons to create in this format: {text: kwargs} {str:}