diff --git a/tgram/bound/callback_query.py b/tgram/bound/callback_query.py index efebe65..cbd4d1d 100644 --- a/tgram/bound/callback_query.py +++ b/tgram/bound/callback_query.py @@ -22,7 +22,7 @@ async def answer( async def edit_message_text( self: "tgram.types.CallbackQuery", text: str, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, entities: List["tgram.types.MessageEntity"] = None, link_preview_options: "tgram.types.LinkPreviewOptions" = None, reply_markup: "tgram.types.InlineKeyboardMarkup" = None, @@ -43,7 +43,7 @@ async def edit_message_text( async def edit_message_caption( self: "tgram.types.CallbackQuery", caption: str = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, reply_markup: "tgram.types.InlineKeyboardMarkup" = None, diff --git a/tgram/bound/message.py b/tgram/bound/message.py index 8edf1f5..40d9731 100644 --- a/tgram/bound/message.py +++ b/tgram/bound/message.py @@ -54,7 +54,7 @@ async def reply_text( self: "tgram.types.Message", text: str, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, entities: List["tgram.types.MessageEntity"] = None, link_preview_options: "tgram.types.LinkPreviewOptions" = None, disable_notification: bool = None, @@ -91,7 +91,7 @@ async def reply_photo( photo: Union[Path, bytes, str], caption: str = None, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, @@ -129,7 +129,7 @@ async def reply_audio( audio: Union[Path, bytes, str], caption: str = None, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, duration: int = None, performer: str = None, @@ -172,7 +172,7 @@ async def reply_document( message_thread_id: int = None, thumbnail: Union[Path, bytes, str] = None, caption: str = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, disable_content_type_detection: bool = None, disable_notification: bool = None, @@ -213,7 +213,7 @@ async def reply_video( height: int = None, thumbnail: Union[Path, bytes, str] = None, caption: str = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, @@ -261,7 +261,7 @@ async def reply_animation( height: int = None, thumbnail: Union[Path, bytes, str] = None, caption: str = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, @@ -303,7 +303,7 @@ async def reply_voice( voice: Union[Path, bytes, str], caption: str = None, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, duration: int = None, disable_notification: bool = None, @@ -432,7 +432,7 @@ async def reply_paid_media( star_count: int, media: List["tgram.types.InputPaidMedia"], caption: str = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, disable_notification: bool = None, @@ -671,7 +671,7 @@ async def reply_media_from_file_id( file_id: str, caption: str = None, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, disable_notification: bool = None, @@ -707,7 +707,7 @@ async def copy( chat_id: Union[int, str], caption: str = None, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, disable_notification: bool = None, @@ -740,7 +740,7 @@ async def copy( async def edit_text( self: "tgram.types.Message", text: str, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, entities: List["tgram.types.MessageEntity"] = None, link_preview_options: "tgram.types.LinkPreviewOptions" = None, reply_markup: "tgram.types.InlineKeyboardMarkup" = None, @@ -761,7 +761,7 @@ async def edit_text( async def edit_caption( self: "tgram.types.Message", caption: str = None, - parse_mode: str = None, + parse_mode: "tgram.types.ParseMode" = None, caption_entities: List["tgram.types.MessageEntity"] = None, show_caption_above_media: bool = None, reply_markup: "tgram.types.InlineKeyboardMarkup" = None, diff --git a/tgram/methods/copy_message.py b/tgram/methods/copy_message.py index f38ae5d..03454eb 100644 --- a/tgram/methods/copy_message.py +++ b/tgram/methods/copy_message.py @@ -8,6 +8,7 @@ from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove from tgram.types import ReplyParameters +from tgram.types import ParseMode class CopyMessage: @@ -18,7 +19,7 @@ async def copy_message( message_id: int, message_thread_id: int = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, diff --git a/tgram/methods/edit_message_caption.py b/tgram/methods/edit_message_caption.py index 47c3ab5..92ade61 100644 --- a/tgram/methods/edit_message_caption.py +++ b/tgram/methods/edit_message_caption.py @@ -4,6 +4,7 @@ from tgram.types import InlineKeyboardMarkup from tgram.types import Message from tgram.types import MessageEntity +from tgram.types import ParseMode class EditMessageCaption: @@ -14,7 +15,7 @@ async def edit_message_caption( message_id: int = None, inline_message_id: str = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, reply_markup: InlineKeyboardMarkup = None, diff --git a/tgram/methods/edit_message_text.py b/tgram/methods/edit_message_text.py index 319af7e..30626b7 100644 --- a/tgram/methods/edit_message_text.py +++ b/tgram/methods/edit_message_text.py @@ -4,7 +4,7 @@ from tgram.types import InlineKeyboardMarkup from tgram.types import LinkPreviewOptions from tgram.types import Message -from tgram.types import MessageEntity +from tgram.types import MessageEntity, ParseMode class EditMessageText: @@ -15,7 +15,7 @@ async def edit_message_text( chat_id: Union[int, str] = None, message_id: int = None, inline_message_id: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None, diff --git a/tgram/methods/send_animation.py b/tgram/methods/send_animation.py index 7a908c8..0dd9f25 100644 --- a/tgram/methods/send_animation.py +++ b/tgram/methods/send_animation.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from pathlib import Path from tgram.utils import get_file_path @@ -24,7 +24,7 @@ async def send_animation( height: int = None, thumbnail: Union[Path, bytes, str] = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, diff --git a/tgram/methods/send_audio.py b/tgram/methods/send_audio.py index 1d72032..b99205d 100644 --- a/tgram/methods/send_audio.py +++ b/tgram/methods/send_audio.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from pathlib import Path from tgram.utils import get_file_path @@ -20,7 +20,7 @@ async def send_audio( business_connection_id: str = None, message_thread_id: int = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, duration: int = None, performer: str = None, diff --git a/tgram/methods/send_document.py b/tgram/methods/send_document.py index 278fbe0..54b55f7 100644 --- a/tgram/methods/send_document.py +++ b/tgram/methods/send_document.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from pathlib import Path from tgram.utils import get_file_path @@ -21,7 +21,7 @@ async def send_document( message_thread_id: int = None, thumbnail: Union[Path, bytes, str] = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, disable_content_type_detection: bool = None, disable_notification: bool = None, diff --git a/tgram/methods/send_media_from_file_id.py b/tgram/methods/send_media_from_file_id.py index 5fc6f47..79aa276 100644 --- a/tgram/methods/send_media_from_file_id.py +++ b/tgram/methods/send_media_from_file_id.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from tgram import utils @@ -20,7 +20,7 @@ async def send_media_from_file_id( business_connection_id: str = None, message_thread_id: int = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, diff --git a/tgram/methods/send_message.py b/tgram/methods/send_message.py index 52d0adf..44af01e 100644 --- a/tgram/methods/send_message.py +++ b/tgram/methods/send_message.py @@ -8,7 +8,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode class SendMessage: @@ -18,7 +18,7 @@ async def send_message( text: str, business_connection_id: str = None, message_thread_id: int = None, - parse_mode: str = None, + parse_mode: ParseMode = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, disable_notification: bool = None, diff --git a/tgram/methods/send_paid_media.py b/tgram/methods/send_paid_media.py index b378834..1d15136 100644 --- a/tgram/methods/send_paid_media.py +++ b/tgram/methods/send_paid_media.py @@ -8,7 +8,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from tgram.utils import convert_input_media @@ -21,7 +21,7 @@ async def send_paid_media( media: List[InputPaidMedia], payload: str = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, diff --git a/tgram/methods/send_photo.py b/tgram/methods/send_photo.py index af52d8d..51c4e7d 100644 --- a/tgram/methods/send_photo.py +++ b/tgram/methods/send_photo.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from pathlib import Path from tgram.utils import get_file_path @@ -20,7 +20,7 @@ async def send_photo( business_connection_id: str = None, message_thread_id: int = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, diff --git a/tgram/methods/send_poll.py b/tgram/methods/send_poll.py index a2c8f99..8a55378 100644 --- a/tgram/methods/send_poll.py +++ b/tgram/methods/send_poll.py @@ -8,7 +8,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode class SendPoll: @@ -19,14 +19,14 @@ async def send_poll( options: List[InputPollOption], business_connection_id: str = None, message_thread_id: int = None, - question_parse_mode: str = None, + question_parse_mode: ParseMode = None, question_entities: List[MessageEntity] = None, is_anonymous: bool = None, type: str = None, allows_multiple_answers: bool = None, correct_option_id: int = None, explanation: str = None, - explanation_parse_mode: str = None, + explanation_parse_mode: ParseMode = None, explanation_entities: List[MessageEntity] = None, open_period: int = None, close_date: int = None, diff --git a/tgram/methods/send_video.py b/tgram/methods/send_video.py index 36a9a59..6d37a88 100644 --- a/tgram/methods/send_video.py +++ b/tgram/methods/send_video.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from pathlib import Path from tgram.utils import get_file_path @@ -24,7 +24,7 @@ async def send_video( height: int = None, thumbnail: Union[Path, bytes, str] = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, diff --git a/tgram/methods/send_voice.py b/tgram/methods/send_voice.py index 6c6b8d1..0130b75 100644 --- a/tgram/methods/send_voice.py +++ b/tgram/methods/send_voice.py @@ -7,7 +7,7 @@ from tgram.types import MessageEntity from tgram.types import ReplyKeyboardMarkup from tgram.types import ReplyKeyboardRemove -from tgram.types import ReplyParameters +from tgram.types import ReplyParameters, ParseMode from pathlib import Path from tgram.utils import get_file_path @@ -20,7 +20,7 @@ async def send_voice( business_connection_id: str = None, message_thread_id: int = None, caption: str = None, - parse_mode: str = None, + parse_mode: ParseMode = None, caption_entities: List[MessageEntity] = None, duration: int = None, disable_notification: bool = None, diff --git a/tgram/types/__init__.py b/tgram/types/__init__.py index 3f85658..48baeb9 100644 --- a/tgram/types/__init__.py +++ b/tgram/types/__init__.py @@ -510,4 +510,5 @@ "WebAppInfo", "WebhookInfo", "WriteAccessAllowed", + "ParseMode", ]