diff --git a/tgram/methods/copy_message.py b/tgram/methods/copy_message.py index f64032f..7b7ef32 100644 --- a/tgram/methods/copy_message.py +++ b/tgram/methods/copy_message.py @@ -93,7 +93,7 @@ async def copy_message( message_id=message_id, message_thread_id=message_thread_id, caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, diff --git a/tgram/methods/edit_message_caption.py b/tgram/methods/edit_message_caption.py index 462e619..35d9144 100644 --- a/tgram/methods/edit_message_caption.py +++ b/tgram/methods/edit_message_caption.py @@ -29,7 +29,7 @@ async def edit_message_caption( message_id=message_id, inline_message_id=inline_message_id, caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, reply_markup=reply_markup, diff --git a/tgram/methods/edit_message_text.py b/tgram/methods/edit_message_text.py index 395678b..f8743d5 100644 --- a/tgram/methods/edit_message_text.py +++ b/tgram/methods/edit_message_text.py @@ -29,7 +29,7 @@ async def edit_message_text( chat_id=chat_id, message_id=message_id, inline_message_id=inline_message_id, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), entities=entities, link_preview_options=link_preview_options or self.link_preview_options, reply_markup=reply_markup, diff --git a/tgram/methods/send_animation.py b/tgram/methods/send_animation.py index 96a688b..5050d58 100644 --- a/tgram/methods/send_animation.py +++ b/tgram/methods/send_animation.py @@ -129,7 +129,7 @@ async def send_animation( height=height, thumbnail=get_file_path(thumbnail), caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, diff --git a/tgram/methods/send_audio.py b/tgram/methods/send_audio.py index e1c89c7..af5ce5a 100644 --- a/tgram/methods/send_audio.py +++ b/tgram/methods/send_audio.py @@ -120,7 +120,7 @@ async def send_audio( business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, duration=duration, performer=performer, diff --git a/tgram/methods/send_document.py b/tgram/methods/send_document.py index b993854..3c3ff05 100644 --- a/tgram/methods/send_document.py +++ b/tgram/methods/send_document.py @@ -112,7 +112,7 @@ async def send_document( message_thread_id=message_thread_id, thumbnail=get_file_path(thumbnail), caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, disable_content_type_detection=disable_content_type_detection, disable_notification=disable_notification, diff --git a/tgram/methods/send_message.py b/tgram/methods/send_message.py index bd3b7e7..a189c08 100644 --- a/tgram/methods/send_message.py +++ b/tgram/methods/send_message.py @@ -99,7 +99,7 @@ async def send_message( text=text, business_connection_id=business_connection_id, message_thread_id=message_thread_id, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), entities=entities, link_preview_options=link_preview_options or self.link_preview_options, disable_notification=disable_notification, diff --git a/tgram/methods/send_paid_media.py b/tgram/methods/send_paid_media.py index 5c05ccc..9884d5f 100644 --- a/tgram/methods/send_paid_media.py +++ b/tgram/methods/send_paid_media.py @@ -87,7 +87,7 @@ async def send_paid_media( media=arr, payload=payload, caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, diff --git a/tgram/methods/send_photo.py b/tgram/methods/send_photo.py index 468b178..7db52c5 100644 --- a/tgram/methods/send_photo.py +++ b/tgram/methods/send_photo.py @@ -103,7 +103,7 @@ async def send_photo( business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, diff --git a/tgram/methods/send_video.py b/tgram/methods/send_video.py index a6ce17e..c807e48 100644 --- a/tgram/methods/send_video.py +++ b/tgram/methods/send_video.py @@ -131,7 +131,7 @@ async def send_video( height=height, thumbnail=get_file_path(thumbnail), caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, show_caption_above_media=show_caption_above_media, has_spoiler=has_spoiler, diff --git a/tgram/methods/send_voice.py b/tgram/methods/send_voice.py index c241f6a..f56a47c 100644 --- a/tgram/methods/send_voice.py +++ b/tgram/methods/send_voice.py @@ -97,7 +97,7 @@ async def send_voice( business_connection_id=business_connection_id, message_thread_id=message_thread_id, caption=caption, - pparse_mode=get_parse_mode(self, parse_mode), + parse_mode=get_parse_mode(self, parse_mode), caption_entities=caption_entities, duration=duration, disable_notification=disable_notification, diff --git a/tgram/utils/parse_mode.py b/tgram/utils/parse_mode.py index 67df721..06c7e4c 100644 --- a/tgram/utils/parse_mode.py +++ b/tgram/utils/parse_mode.py @@ -6,7 +6,8 @@ def get_parse_mode( bot: Optional["tgram.TgBot"] = None, parse_mode: Optional[str] = None ) -> Optional[str]: - if parse_mode and parse_mode.lower() in ('d', 'disable', 'disabled'): - return None - else: - return parse_mode or (bot.parse_mode if bot else None) + return ( + None + if parse_mode and parse_mode.lower() in ("d", "disable", "disabled") + else parse_mode or (bot.parse_mode if bot else None) + )