Skip to content

Commit

Permalink
Added the fields chat and id to the class Story.
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2020official committed Feb 16, 2024
1 parent 86285a6 commit 1eceda1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions telebot/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8063,19 +8063,31 @@ def to_json(self) -> str:

class Story(JsonDeserializable):
"""
This object represents a message about a forwarded story in the chat.
Currently holds no information.
This object represents a story.
Telegram documentation: https://core.telegram.org/bots/api#story
:param chat: Chat that posted the story
:type chat: :class:`telebot.types.Chat`
:param id: Unique identifier for the story in the chat
:type id: :obj:`int`
:return: Instance of the class
:rtype: :class:`Story`
"""

@classmethod
def de_json(cls, json_string):
if json_string is None:
return None
obj = cls.check_json(json_string)
obj['chat'] = Chat.de_json(obj['chat'])
return cls(**obj)

def __init__(self, **kwargs) -> None:
pass

def __init__(self, chat: Chat, id: int, **kwargs) -> None:
self.chat: Chat = chat
self.id: int = id


# base class
Expand Down

0 comments on commit 1eceda1

Please sign in to comment.