Remove ParseMode
It's pretty much useless, better just use "markdown" and "html"
This commit is contained in:
parent
1737ba5f49
commit
3a494a478f
@ -17,9 +17,9 @@
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .client import Client
|
||||
from .ext import BaseClient, ChatAction, Emoji, ParseMode
|
||||
from .ext import BaseClient, ChatAction, Emoji
|
||||
from .filters import Filters
|
||||
|
||||
__all__ = [
|
||||
"Client", "BaseClient", "ChatAction", "Emoji", "ParseMode", "Filters",
|
||||
"Client", "BaseClient", "ChatAction", "Emoji", "Filters",
|
||||
]
|
||||
|
@ -20,5 +20,4 @@ from .base_client import BaseClient
|
||||
from .chat_action import ChatAction
|
||||
from .dispatcher import Dispatcher
|
||||
from .emoji import Emoji
|
||||
from .parse_mode import ParseMode
|
||||
from .syncer import Syncer
|
||||
|
@ -1,29 +0,0 @@
|
||||
# Pyrogram - Telegram MTProto API Client Library for Python
|
||||
# Copyright (C) 2017-2019 Dan Tès <https://github.com/delivrance>
|
||||
#
|
||||
# This file is part of Pyrogram.
|
||||
#
|
||||
# Pyrogram is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published
|
||||
# by the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Pyrogram is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
class ParseMode:
|
||||
"""This class provides a convenient access to Parse Modes.
|
||||
Parse Modes are intended to be used with any method that accepts the optional argument **parse_mode**.
|
||||
"""
|
||||
|
||||
HTML = "html"
|
||||
"""Set the parse mode to HTML style"""
|
||||
|
||||
MARKDOWN = "markdown"
|
||||
"""Set the parse mode to Markdown style"""
|
@ -22,7 +22,7 @@ from typing import List, Match, Union
|
||||
import pyrogram
|
||||
from pyrogram.api import types
|
||||
from pyrogram.errors import MessageIdsEmpty
|
||||
from pyrogram.client.ext import ChatAction, ParseMode
|
||||
from pyrogram.client.ext import ChatAction
|
||||
from pyrogram.client.types.input_media import InputMedia
|
||||
from .contact import Contact
|
||||
from .location import Location
|
||||
@ -2686,7 +2686,7 @@ class Message(PyrogramType, Update):
|
||||
if self.sticker or self.video_note: # Sticker and VideoNote should have no caption
|
||||
return send_media(file_id=file_id)
|
||||
else:
|
||||
return send_media(file_id=file_id, caption=caption, parse_mode=ParseMode.HTML)
|
||||
return send_media(file_id=file_id, caption=caption, parse_mode="html")
|
||||
else:
|
||||
raise ValueError("Can't copy this message")
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user