mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
Pyrofork: Update MessageStory to layer 164
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
6a99126485
commit
0c79eb27db
1 changed files with 10 additions and 10 deletions
|
|
@ -16,10 +16,7 @@
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from typing import Optional, List
|
from pyrogram import raw
|
||||||
|
|
||||||
import pyrogram
|
|
||||||
from pyrogram import raw, types
|
|
||||||
from ..object import Object
|
from ..object import Object
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -27,28 +24,31 @@ class MessageStory(Object):
|
||||||
"""Contains information about a forwarded story.
|
"""Contains information about a forwarded story.
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
user_id (``int``):
|
from_id (``int``):
|
||||||
Unique user identifier of story sender.
|
Unique user/channel identifier of story sender.
|
||||||
|
|
||||||
story_id (``int``):
|
story_id (``int``):
|
||||||
Unique story identifier.
|
Unique story identifier.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
user_id: int,
|
from_id: int,
|
||||||
story_id: int
|
story_id: int
|
||||||
):
|
):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self.user_id = user_id
|
self.from_id = from_id
|
||||||
self.story_id = story_id
|
self.story_id = story_id
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse(message_story: "raw.types.MessageMediaStory") -> "MessageStory":
|
def _parse(message_story: "raw.types.MessageMediaStory") -> "MessageStory":
|
||||||
|
if isinstance(message_story.peer, raw.types.PeerChannel):
|
||||||
|
from_id = message_story.peer.channel_id
|
||||||
|
else:
|
||||||
|
from_id = message_story.peer.user_id
|
||||||
return MessageStory(
|
return MessageStory(
|
||||||
user_id=message_story.user_id,
|
from_id=from_id,
|
||||||
story_id=message_story.id
|
story_id=message_story.id
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue