Rename increment_message_views method to view_messages

This commit is contained in:
KurimuzonAkuma 2024-05-11 16:10:32 +03:00
parent d2b710da9a
commit 06f689ebdb
4 changed files with 9 additions and 9 deletions

View File

@ -178,12 +178,12 @@ def pyrogram_api():
get_messages
get_scheduled_messages
get_stickers
increment_message_views
get_media_group
get_chat_history
get_chat_history_count
read_chat_history
send_poll
view_messages
vote_poll
stop_poll
retract_vote

View File

@ -39,7 +39,6 @@ from .get_media_group import GetMediaGroup
from .get_messages import GetMessages
from .get_scheduled_messages import GetScheduledMessages
from .get_stickers import GetStickers
from .increment_message_views import IncrementMessageViews
from .read_chat_history import ReadChatHistory
from .read_mentions import ReadMentions
from .read_reactions import ReadReactions
@ -70,6 +69,7 @@ from .send_web_page import SendWebPage
from .start_bot import StartBot
from .stop_poll import StopPoll
from .stream_media import StreamMedia
from .view_messages import ViewMessages
from .vote_poll import VotePoll
@ -100,6 +100,7 @@ class Messages(
SendVoice,
SendPoll,
SendWebPage,
ViewMessages,
VotePoll,
StartBot,
StopPoll,
@ -108,7 +109,6 @@ class Messages(
GetChatHistory,
SendCachedMedia,
GetChatHistoryCount,
IncrementMessageViews,
ReadChatHistory,
ReadMentions,
ReadReactions,

View File

@ -22,13 +22,13 @@ import pyrogram
from pyrogram import raw
class IncrementMessageViews:
async def increment_message_views(
class ViewMessages:
async def view_messages(
self: "pyrogram.Client",
chat_id: Union[int, str],
message_id: Union[int, List[int]],
) -> bool:
"""Increment message views.
"""Increment message views counter.
.. include:: /_includes/usable-by/users.rst
@ -46,7 +46,7 @@ class IncrementMessageViews:
.. code-block:: python
# Increment message views
await app.increment_message_views(chat_id, 1)
await app.view_messages(chat_id, 1)
"""
ids = [message_id] if not isinstance(message_id, list) else message_id

View File

@ -4700,7 +4700,7 @@ class Message(Object, Update):
.. code-block:: python
await client.increment_message_views(
await client.view_messages(
chat_id=message.chat.id,
message_id=message_id
)
@ -4716,7 +4716,7 @@ class Message(Object, Update):
Raises:
RPCError: In case of a Telegram RPC error.
"""
return await self._client.increment_message_views(
return await self._client.view_messages(
chat_id=self.chat.id,
message_id=self.id
)