Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
z44d committed Oct 12, 2024
1 parent ce2f984 commit 28b9eae
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tgram/methods/copy_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/edit_message_caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/edit_message_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_paid_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tgram/methods/send_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions tgram/utils/parse_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

0 comments on commit 28b9eae

Please sign in to comment.