mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Rename increment_story_views to view_stories
This commit is contained in:
parent
cc4aa8a2d3
commit
cdcd805cb5
@ -388,7 +388,7 @@ def pyrogram_api():
|
|||||||
get_stories_archive
|
get_stories_archive
|
||||||
get_stories
|
get_stories
|
||||||
hide_stories
|
hide_stories
|
||||||
increment_story_views
|
view_stories
|
||||||
pin_stories
|
pin_stories
|
||||||
read_stories
|
read_stories
|
||||||
send_story
|
send_story
|
||||||
@ -725,6 +725,7 @@ def pyrogram_api():
|
|||||||
Story.forward
|
Story.forward
|
||||||
Story.download
|
Story.download
|
||||||
Story.read
|
Story.read
|
||||||
|
Story.view
|
||||||
""",
|
""",
|
||||||
folder="""
|
folder="""
|
||||||
Folder
|
Folder
|
||||||
|
@ -29,7 +29,7 @@ from .get_pinned_stories import GetPinnedStories
|
|||||||
from .get_stories import GetStories
|
from .get_stories import GetStories
|
||||||
from .get_stories_archive import GetStoriesArchive
|
from .get_stories_archive import GetStoriesArchive
|
||||||
from .hide_stories import HideStories
|
from .hide_stories import HideStories
|
||||||
from .increment_story_views import IncrementStoryViews
|
from .view_stories import ViewStories
|
||||||
from .pin_stories import PinStories
|
from .pin_stories import PinStories
|
||||||
from .read_stories import ReadStories
|
from .read_stories import ReadStories
|
||||||
from .send_story import SendStory
|
from .send_story import SendStory
|
||||||
@ -48,7 +48,7 @@ class Stories(
|
|||||||
GetStories,
|
GetStories,
|
||||||
GetStoriesArchive,
|
GetStoriesArchive,
|
||||||
HideStories,
|
HideStories,
|
||||||
IncrementStoryViews,
|
ViewStories,
|
||||||
PinStories,
|
PinStories,
|
||||||
ReadStories,
|
ReadStories,
|
||||||
SendStory,
|
SendStory,
|
||||||
|
@ -22,8 +22,8 @@ import pyrogram
|
|||||||
from pyrogram import raw
|
from pyrogram import raw
|
||||||
|
|
||||||
|
|
||||||
class IncrementStoryViews:
|
class ViewStories:
|
||||||
async def increment_story_views(
|
async def view_stories(
|
||||||
self: "pyrogram.Client",
|
self: "pyrogram.Client",
|
||||||
chat_id: Union[int, str],
|
chat_id: Union[int, str],
|
||||||
story_id: Union[int, List[int]],
|
story_id: Union[int, List[int]],
|
||||||
@ -47,7 +47,7 @@ class IncrementStoryViews:
|
|||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
# Increment story views
|
# Increment story views
|
||||||
await app.increment_story_views(chat_id, 1)
|
await app.view_stories(chat_id, 1)
|
||||||
"""
|
"""
|
||||||
ids = [story_id] if not isinstance(story_id, list) else story_id
|
ids = [story_id] if not isinstance(story_id, list) else story_id
|
||||||
|
|
@ -1835,3 +1835,25 @@ class Story(Object, Update):
|
|||||||
chat_id=self.chat.id,
|
chat_id=self.chat.id,
|
||||||
max_id=self.id
|
max_id=self.id
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def view(self) -> List[int]:
|
||||||
|
"""Bound method *view* of :obj:`~pyrogram.types.Story`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
await story.view()
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
True on success, False otherwise.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
# Read stories
|
||||||
|
await app.view_stories(chat_id)
|
||||||
|
"""
|
||||||
|
return await self._client.view_stories(
|
||||||
|
chat_id=self.chat.id,
|
||||||
|
story_id=self.id
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user