diff --git a/pyrogram/dispatcher.py b/pyrogram/dispatcher.py
index 7e5adca3..2cd95e88 100644
--- a/pyrogram/dispatcher.py
+++ b/pyrogram/dispatcher.py
@@ -66,8 +66,13 @@ class Dispatcher:
async def message_parser(update, users, chats):
return (
- await pyrogram.types.Message._parse(self.client, update.message, users, chats, None,
- isinstance(update, UpdateNewScheduledMessage)),
+ await pyrogram.types.Message._parse(
+ self.client,
+ update.message,
+ users,
+ chats,
+ is_scheduled=isinstance(update, UpdateNewScheduledMessage)
+ ),
MessageHandler
)
diff --git a/pyrogram/methods/bots/send_game.py b/pyrogram/methods/bots/send_game.py
index bf49c884..4027e0df 100644
--- a/pyrogram/methods/bots/send_game.py
+++ b/pyrogram/methods/bots/send_game.py
@@ -60,7 +60,7 @@ class SendGame:
message_thread_id (``int``, *optional*):
Unique identifier of a message thread to which the message belongs.
- for supergroups only
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/bots/send_inline_bot_result.py b/pyrogram/methods/bots/send_inline_bot_result.py
index b33fc4d9..d8124224 100644
--- a/pyrogram/methods/bots/send_inline_bot_result.py
+++ b/pyrogram/methods/bots/send_inline_bot_result.py
@@ -60,7 +60,7 @@ class SendInlineBotResult:
message_thread_id (``int``, *optional*):
Unique identifier of a message thread to which the message belongs.
- for supergroups only
+ For supergroups only.
reply_to_message_id (``bool``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/copy_media_group.py b/pyrogram/methods/messages/copy_media_group.py
index c851c91d..0ddba8a2 100644
--- a/pyrogram/methods/messages/copy_media_group.py
+++ b/pyrogram/methods/messages/copy_media_group.py
@@ -74,7 +74,7 @@ class CopyMediaGroup:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/copy_message.py b/pyrogram/methods/messages/copy_message.py
index 0ef82064..3d99858d 100644
--- a/pyrogram/methods/messages/copy_message.py
+++ b/pyrogram/methods/messages/copy_message.py
@@ -87,7 +87,7 @@ class CopyMessage:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/forward_messages.py b/pyrogram/methods/messages/forward_messages.py
index 6bc12d46..aa017ba0 100644
--- a/pyrogram/methods/messages/forward_messages.py
+++ b/pyrogram/methods/messages/forward_messages.py
@@ -54,7 +54,8 @@ class ForwardMessages:
An iterable of message identifiers in the chat specified in *from_chat_id* or a single message id.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
disable_notification (``bool``, *optional*):
Sends the message silently.
diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py
index 128c137a..367a3f16 100644
--- a/pyrogram/methods/messages/send_animation.py
+++ b/pyrogram/methods/messages/send_animation.py
@@ -122,7 +122,7 @@ class SendAnimation:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_audio.py b/pyrogram/methods/messages/send_audio.py
index 75e28787..effb81e9 100644
--- a/pyrogram/methods/messages/send_audio.py
+++ b/pyrogram/methods/messages/send_audio.py
@@ -115,7 +115,7 @@ class SendAudio:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_cached_media.py b/pyrogram/methods/messages/send_cached_media.py
index 05c43a98..1dbd7c93 100644
--- a/pyrogram/methods/messages/send_cached_media.py
+++ b/pyrogram/methods/messages/send_cached_media.py
@@ -84,7 +84,7 @@ class SendCachedMedia:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_contact.py b/pyrogram/methods/messages/send_contact.py
index 090a135e..3c523f20 100644
--- a/pyrogram/methods/messages/send_contact.py
+++ b/pyrogram/methods/messages/send_contact.py
@@ -78,7 +78,7 @@ class SendContact:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_dice.py b/pyrogram/methods/messages/send_dice.py
index ccec9035..7e953fb7 100644
--- a/pyrogram/methods/messages/send_dice.py
+++ b/pyrogram/methods/messages/send_dice.py
@@ -69,7 +69,7 @@ class SendDice:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_document.py b/pyrogram/methods/messages/send_document.py
index 6ebe173e..749e79e2 100644
--- a/pyrogram/methods/messages/send_document.py
+++ b/pyrogram/methods/messages/send_document.py
@@ -107,7 +107,7 @@ class SendDocument:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_location.py b/pyrogram/methods/messages/send_location.py
index a4242bca..0b0be60f 100644
--- a/pyrogram/methods/messages/send_location.py
+++ b/pyrogram/methods/messages/send_location.py
@@ -68,7 +68,7 @@ class SendLocation:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
diff --git a/pyrogram/methods/messages/send_media_group.py b/pyrogram/methods/messages/send_media_group.py
index 6b00fadb..efd9b804 100644
--- a/pyrogram/methods/messages/send_media_group.py
+++ b/pyrogram/methods/messages/send_media_group.py
@@ -74,7 +74,7 @@ class SendMediaGroup:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_message.py b/pyrogram/methods/messages/send_message.py
index 03dbe12a..ce254636 100644
--- a/pyrogram/methods/messages/send_message.py
+++ b/pyrogram/methods/messages/send_message.py
@@ -77,7 +77,7 @@ class SendMessage:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_photo.py b/pyrogram/methods/messages/send_photo.py
index ad144352..f5d8af42 100644
--- a/pyrogram/methods/messages/send_photo.py
+++ b/pyrogram/methods/messages/send_photo.py
@@ -98,7 +98,7 @@ class SendPhoto:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_poll.py b/pyrogram/methods/messages/send_poll.py
index 58952307..feeadd4b 100644
--- a/pyrogram/methods/messages/send_poll.py
+++ b/pyrogram/methods/messages/send_poll.py
@@ -121,7 +121,7 @@ class SendPoll:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_sticker.py b/pyrogram/methods/messages/send_sticker.py
index c87d558e..eff14067 100644
--- a/pyrogram/methods/messages/send_sticker.py
+++ b/pyrogram/methods/messages/send_sticker.py
@@ -78,7 +78,7 @@ class SendSticker:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_venue.py b/pyrogram/methods/messages/send_venue.py
index 71093152..181bff05 100644
--- a/pyrogram/methods/messages/send_venue.py
+++ b/pyrogram/methods/messages/send_venue.py
@@ -85,7 +85,7 @@ class SendVenue:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
diff --git a/pyrogram/methods/messages/send_video.py b/pyrogram/methods/messages/send_video.py
index c32d20b3..6f6f8a6d 100644
--- a/pyrogram/methods/messages/send_video.py
+++ b/pyrogram/methods/messages/send_video.py
@@ -128,7 +128,7 @@ class SendVideo:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
diff --git a/pyrogram/methods/messages/send_video_note.py b/pyrogram/methods/messages/send_video_note.py
index 2188c3ff..d467507e 100644
--- a/pyrogram/methods/messages/send_video_note.py
+++ b/pyrogram/methods/messages/send_video_note.py
@@ -92,7 +92,7 @@ class SendVideoNote:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
diff --git a/pyrogram/methods/messages/send_voice.py b/pyrogram/methods/messages/send_voice.py
index 02f36be3..fac6b054 100644
--- a/pyrogram/methods/messages/send_voice.py
+++ b/pyrogram/methods/messages/send_voice.py
@@ -93,7 +93,7 @@ class SendVoice:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
diff --git a/pyrogram/methods/stories/forward_story.py b/pyrogram/methods/stories/forward_story.py
index c2aa68b0..933eb558 100644
--- a/pyrogram/methods/stories/forward_story.py
+++ b/pyrogram/methods/stories/forward_story.py
@@ -58,7 +58,7 @@ class ForwardStory:
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent.
diff --git a/pyrogram/types/input_message_content/__init__.py b/pyrogram/types/input_message_content/__init__.py
index 4936aaff..b445f3ba 100644
--- a/pyrogram/types/input_message_content/__init__.py
+++ b/pyrogram/types/input_message_content/__init__.py
@@ -17,10 +17,8 @@
# along with Pyrogram. If not, see .
from .input_message_content import InputMessageContent
-from .input_reply_to_message import InputReplyToMessage
-from .input_reply_to_story import InputReplyToStory
from .input_text_message_content import InputTextMessageContent
__all__ = [
- "InputMessageContent", "InputReplyToMessage", "InputReplyToStory", "InputTextMessageContent"
+ "InputMessageContent", "InputTextMessageContent"
]
diff --git a/pyrogram/types/input_message_content/input_reply_to_message.py b/pyrogram/types/input_message_content/input_reply_to_message.py
deleted file mode 100644
index e0c7ca9f..00000000
--- a/pyrogram/types/input_message_content/input_reply_to_message.py
+++ /dev/null
@@ -1,52 +0,0 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
-# Copyright (C) 2017-present Dan
-#
-# 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 .
-
-from pyrogram import raw
-from ..object import Object
-
-
-class InputReplyToMessage(Object):
- """Contains information about a target replied message.
-
- Parameters:
- reply_to_message_id (``int``, *optional*):
- ID of the original message you want to reply.
-
- message_thread_id (``int``, *optional*):
- Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
- """
-
- def __init__(
- self, *,
- reply_to_message_id: int = None,
- message_thread_id: int = None
- ):
- super().__init__()
-
- self.reply_to_message_id = reply_to_message_id
- self.message_thread_id = message_thread_id
-
- def write(self):
- if not any((self.reply_to_message_id, self.message_thread_id)):
- return None
-
- return raw.types.InputReplyToMessage(
- reply_to_msg_id=self.reply_to_message_id or message_thread_id, # type: ignore[arg-type]
- top_msg_id=self.message_thread_id if self.reply_to_message_id else None,
- ).write()
diff --git a/pyrogram/types/input_message_content/input_reply_to_story.py b/pyrogram/types/input_message_content/input_reply_to_story.py
deleted file mode 100644
index fe00af25..00000000
--- a/pyrogram/types/input_message_content/input_reply_to_story.py
+++ /dev/null
@@ -1,48 +0,0 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
-# Copyright (C) 2017-present Dan
-#
-# 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 .
-
-from pyrogram import raw
-from ..object import Object
-
-
-class InputReplyToStory(Object):
- """Contains information about a target replied story.
-
- Parameters:
- user_id (:obj:`~pyrogram.raw.types.InputUser`):
- An InputUser.
-
- story_id (``int``):
- Unique identifier for the target story.
- """
-
- def __init__(
- self, *,
- user_id: "raw.types.InputUser" = None,
- story_id: int = None
- ):
- super().__init__()
-
- self.user_id = user_id
- self.story_id = story_id
-
- def write(self):
- return raw.types.InputReplyToStory(
- user_id=self.user_id,
- story_id=self.story_id
- ).write()
diff --git a/pyrogram/types/messages_and_media/forum_topic.py b/pyrogram/types/messages_and_media/forum_topic.py
index 9d5a80ee..a7e425b4 100644
--- a/pyrogram/types/messages_and_media/forum_topic.py
+++ b/pyrogram/types/messages_and_media/forum_topic.py
@@ -16,65 +16,49 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see .
-from pyrogram import raw, types
-from typing import Union
+from pyrogram import raw, utils
from ..object import Object
class ForumTopic(Object):
- # todo
- # notify_settings: `~pyrogram.types.PeerNotifySettings`
- # draft: `~pyrogram.types.DraftMessage`
"""A forum topic.
Parameters:
- id (``Integer``):
- Id of the topic
+ id (``int``):
+ Unique topic identifier inside this chat.
- date (``Integer``):
- Date topic created
+ date (``int``):
+ Date when the topic was created.
- title (``String``):
- Name of the topic
+ title (``str``):
+ The topic title.
- icon_color (``Integer``):
+ icon_color (``int``):
Color of the topic icon in RGB format
- top_message (``Integer``):
- N/A
-
- read_inbox_max_id (``Integer``):
- N/A
-
- read_outbox_max_id (``Integer``):
- N/A
-
- unread_count (``Integer``):
- N/A
-
- unread_mentions_count (``Integer``):
- N/A
-
- unread_reactions_count (``Integer``):
- N/A
-
- from_id (:obj:`~pyrogram.types.PeerChannel` | :obj:`~pyrogram.types.PeerUser`):
- Topic creator.
-
- my (``Boolean``, *optional*):
- N/A
-
- closed (``Boolean``, *optional*):
- N/A
-
- pinned (``Boolean``, *optional*):
- N/A
-
- short (``Boolean``, *optional*):
- N/A
-
- icon_emoji_id (``Integer``, *optional*):
+ icon_emoji_id (``int``, *optional*):
Unique identifier of the custom emoji shown as the topic icon
+
+ top_message (``int``):
+ The last message sent in the topic at this time.
+
+ unread_count (``int``):
+ Amount of unread messages in this topic.
+
+ unread_mentions_count (``int``):
+ Amount of unread messages containing a mention in this topic.
+
+ unread_reactions_count (``int``):
+ Amount of unread messages containing a reaction in this topic.
+
+ is_my (``bool``, *optional*):
+ True, if you are creator of topic.
+
+ is_closed (``bool``, *optional*):
+ True, if the topic is closed.
+
+ is_pinned (``bool``, *optional*):
+ True, if the topic is pinned.
"""
def __init__(
@@ -84,20 +68,14 @@ class ForumTopic(Object):
date: int,
title: str,
icon_color: int,
+ icon_emoji_id: int = None,
top_message: int,
- read_inbox_max_id: int,
- read_outbox_max_id: int,
unread_count: int,
unread_mentions_count: int,
unread_reactions_count: int,
- from_id: Union["types.PeerChannel", "types.PeerUser"],
- # notify_settings: "types.PeerNotifySettings", //todo
- my: bool = None,
- closed: bool = None,
- pinned: bool = None,
- short: bool = None,
- icon_emoji_id: int = None,
- # draft: "types.DraftMessage" = None //todo
+ is_my: bool = None,
+ is_closed: bool = None,
+ is_pinned: bool = None,
):
super().__init__()
@@ -105,46 +83,28 @@ class ForumTopic(Object):
self.date = date
self.title = title
self.icon_color = icon_color
+ self.icon_emoji_id = icon_emoji_id
self.top_message = top_message
- self.read_inbox_max_id = read_inbox_max_id
- self.read_outbox_max_id = read_outbox_max_id
self.unread_count = unread_count
self.unread_mentions_count = unread_mentions_count
self.unread_reactions_count = unread_reactions_count
- self.from_id = from_id
- # self.notify_settings = notify_settings //todo
- self.my = my
- self.closed = closed
- self.pinned = pinned
- self.short = short
- self.icon_emoji_id = icon_emoji_id
- # self.draft = draft //todo
+ self.is_my = is_my
+ self.is_closed = is_closed
+ self.is_pinned = is_pinned
@staticmethod
- def _parse(forum_topic: "raw.types.forum_topic") -> "ForumTopic":
- from_id = forum_topic.from_id
- if isinstance(from_id, raw.types.PeerChannel):
- peer = types.PeerChannel._parse(from_id)
- if isinstance(from_id, raw.types.PeerUser):
- peer = types.PeerUser._parse(from_id)
-
+ def _parse(forum_topic: "raw.types.ForumTopic") -> "ForumTopic":
return ForumTopic(
- id=getattr(forum_topic, "id", None),
- date=getattr(forum_topic, "date", None),
- title=getattr(forum_topic, "title", None),
+ id=forum_topic.id,
+ date=utils.timestamp_to_datetime(forum_topic.date),
+ title=forum_topic.title,
icon_color=getattr(forum_topic, "icon_color", None),
+ icon_emoji_id=getattr(forum_topic, "icon_emoji_id", None),
top_message=getattr(forum_topic, "top_message", None),
- read_inbox_max_id=getattr(forum_topic, "read_inbox_max_id", None),
- read_outbox_max_id=getattr(forum_topic, "read_outbox_max_id", None),
unread_count=getattr(forum_topic, "unread_count", None),
unread_mentions_count=getattr(forum_topic, "unread_mentions_count", None),
unread_reactions_count=getattr(forum_topic, "unread_reactions_count", None),
- from_id=peer,
- # notify_settings=None, //todo
- my=getattr(forum_topic, "my", None),
- closed=getattr(forum_topic, "closed", None),
- pinned=getattr(forum_topic, "pinned", None),
- short=getattr(forum_topic, "short", None),
- icon_emoji_id=getattr(forum_topic, "icon_emoji_id", None),
- # draft=None //todo
+ is_my=getattr(forum_topic, "my", None),
+ is_closed=getattr(forum_topic, "closed", None),
+ is_pinned=getattr(forum_topic, "pinned", None),
)
diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py
index 321c855f..fa743dea 100644
--- a/pyrogram/types/messages_and_media/message.py
+++ b/pyrogram/types/messages_and_media/message.py
@@ -78,7 +78,7 @@ class Message(Object, Update):
chat (:obj:`~pyrogram.types.Chat`, *optional*):
Conversation the message belongs to.
- topics (:obj:`~pyrogram.types.ForumTopic`, *optional*):
+ topic (:obj:`~pyrogram.types.ForumTopic`, *optional*):
Topic the message belongs to.
forward_from (:obj:`~pyrogram.types.User`, *optional*):
@@ -99,12 +99,9 @@ class Message(Object, Update):
forward_date (:py:obj:`~datetime.datetime`, *optional*):
For forwarded messages, date the original message was sent.
- is_topic_message (``bool``, *optional*):
- True, if the message is sent to a forum topic
-
message_thread_id (``int``, *optional*):
Unique identifier of a message thread to which the message belongs.
- for supergroups only
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
The id of the message which this message directly replied to.
@@ -377,14 +374,13 @@ class Message(Object, Update):
sender_chat: "types.Chat" = None,
date: datetime = None,
chat: "types.Chat" = None,
- topics: "types.ForumTopic" = None,
+ topic: "types.ForumTopic" = None,
forward_from: "types.User" = None,
forward_sender_name: str = None,
forward_from_chat: "types.Chat" = None,
forward_from_message_id: int = None,
forward_signature: str = None,
forward_date: datetime = None,
- is_topic_message: bool = None,
message_thread_id: int = None,
reply_to_message_id: int = None,
reply_to_story_id: int = None,
@@ -474,14 +470,13 @@ class Message(Object, Update):
self.sender_chat = sender_chat
self.date = date
self.chat = chat
- self.topics = topics
+ self.topic = topic
self.forward_from = forward_from
self.forward_sender_name = forward_sender_name
self.forward_from_chat = forward_from_chat
self.forward_from_message_id = forward_from_message_id
self.forward_signature = forward_signature
self.forward_date = forward_date
- self.is_topic_message = is_topic_message
self.message_thread_id = message_thread_id
self.reply_to_message_id = reply_to_message_id
self.reply_to_story_id = reply_to_story_id
@@ -606,7 +601,6 @@ class Message(Object, Update):
group_chat_created = None
channel_chat_created = None
new_chat_photo = None
- is_topic_message = None
forum_topic_created = None
forum_topic_closed = None
forum_topic_reopened = None
@@ -708,7 +702,6 @@ class Message(Object, Update):
message_thread_id=message_thread_id,
date=utils.timestamp_to_datetime(message.date),
chat=types.Chat._parse(client, message, users, chats, is_chat=True),
- topics=None,
from_user=from_user,
sender_chat=sender_chat,
service=service_type,
@@ -722,7 +715,6 @@ class Message(Object, Update):
migrate_from_chat_id=-migrate_from_chat_id if migrate_from_chat_id else None,
group_chat_created=group_chat_created,
channel_chat_created=channel_chat_created,
- is_topic_message=is_topic_message,
forum_topic_created=forum_topic_created,
forum_topic_closed=forum_topic_closed,
forum_topic_reopened=forum_topic_reopened,
@@ -775,7 +767,6 @@ class Message(Object, Update):
parsed_message.message_thread_id = message.reply_to.reply_to_top_id
else:
parsed_message.message_thread_id = message.reply_to.reply_to_msg_id
- parsed_message.is_topic_message = True
return parsed_message
@@ -790,7 +781,6 @@ class Message(Object, Update):
forward_from_message_id = None
forward_signature = None
forward_date = None
- is_topic_message = None
forward_header = message.fwd_from # type: raw.types.MessageFwdHeader
@@ -936,7 +926,6 @@ class Message(Object, Update):
message_thread_id=message_thread_id,
date=utils.timestamp_to_datetime(message.date),
chat=types.Chat._parse(client, message, users, chats, is_chat=True),
- topics=None,
from_user=from_user,
sender_chat=sender_chat,
text=(
@@ -968,7 +957,6 @@ class Message(Object, Update):
forward_from_message_id=forward_from_message_id,
forward_signature=forward_signature,
forward_date=forward_date,
- is_topic_message=is_topic_message,
mentioned=message.mentioned,
scheduled=is_scheduled,
from_scheduled=message.from_scheduled,
@@ -1014,14 +1002,13 @@ class Message(Object, Update):
else:
thread_id = message.reply_to.reply_to_msg_id
parsed_message.message_thread_id = thread_id
- parsed_message.is_topic_message = True
if topics:
- parsed_message.topics = types.ForumTopic._parse(topics[thread_id])
+ parsed_message.topic = types.ForumTopic._parse(topics[thread_id])
else:
try:
msg = await client.get_messages(parsed_message.chat.id,message.id)
- if getattr(msg, "topics"):
- parsed_message.topics = msg.topics
+ if msg.topic:
+ parsed_message.topic = msg.topic
except Exception:
pass
else:
@@ -1186,7 +1173,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -1327,7 +1315,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -1485,7 +1474,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -1619,7 +1609,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -1760,7 +1751,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -1892,7 +1884,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -2017,7 +2010,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -2096,7 +2090,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``bool``, *optional*):
If the message is a reply, ID of the original message.
@@ -2189,7 +2184,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
@@ -2274,7 +2270,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -2390,7 +2387,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -2569,7 +2567,8 @@ class Message(Object, Update):
Protects the contents of the sent message from forwarding and saving.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -2683,7 +2682,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -2826,7 +2826,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
@@ -2974,7 +2975,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message.
@@ -3118,7 +3120,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
@@ -3261,7 +3264,8 @@ class Message(Object, Update):
Users will receive a notification with no sound.
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
reply_to_message_id (``int``, *optional*):
If the message is a reply, ID of the original message
@@ -3555,7 +3559,8 @@ class Message(Object, Update):
For a contact that exists in your Telegram address book you can use his phone number (str).
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
disable_notification (``bool``, *optional*):
Sends the message silently.
@@ -3642,7 +3647,7 @@ class Message(Object, Update):
message_thread_id (``int``, *optional*):
Unique identifier for the target message thread (topic) of the forum.
- for forum supergroups only.
+ For supergroups only.
reply_to_chat_id (``int``, *optional*):
If the message is a reply, ID of the original chat.
diff --git a/pyrogram/types/messages_and_media/story.py b/pyrogram/types/messages_and_media/story.py
index 10f1002d..f55a8a7a 100644
--- a/pyrogram/types/messages_and_media/story.py
+++ b/pyrogram/types/messages_and_media/story.py
@@ -1669,7 +1669,8 @@ class Story(Object, Update):
For a contact that exists in your Telegram address book you can use his phone number (str).
message_thread_id (``int``, *optional*):
- Unique identifier of a message thread to which the message belongs; for supergroups only
+ Unique identifier of a message thread to which the message belongs.
+ For supergroups only.
disable_notification (``bool``, *optional*):
Sends the message silently.
diff --git a/pyrogram/types/user_and_chats/__init__.py b/pyrogram/types/user_and_chats/__init__.py
index 8830f501..11f66023 100644
--- a/pyrogram/types/user_and_chats/__init__.py
+++ b/pyrogram/types/user_and_chats/__init__.py
@@ -35,8 +35,6 @@ from .emoji_status import EmojiStatus
from .folder import Folder
from .invite_link_importer import InviteLinkImporter
from .restriction import Restriction
-from .peer_channel import PeerChannel
-from .peer_user import PeerUser
from .user import User
from .username import Username
from .video_chat_ended import VideoChatEnded
@@ -51,8 +49,6 @@ __all__ = [
"ChatPhoto",
"ChatPreview",
"Dialog",
- "PeerChannel",
- "PeerUser",
"User",
"Username",
"Restriction",
diff --git a/pyrogram/types/user_and_chats/chat.py b/pyrogram/types/user_and_chats/chat.py
index 14accfb1..0f600549 100644
--- a/pyrogram/types/user_and_chats/chat.py
+++ b/pyrogram/types/user_and_chats/chat.py
@@ -37,7 +37,7 @@ class Chat(Object):
Type of chat.
is_forum (``bool``, *optional*):
- True, if the supergroup chat is a forum
+ True, if the supergroup chat is a forum.
is_verified (``bool``, *optional*):
True, if this chat has been verified by Telegram. Supergroups, channels and bots only.
diff --git a/pyrogram/types/user_and_chats/chat_permissions.py b/pyrogram/types/user_and_chats/chat_permissions.py
index d1c99c70..a96f59da 100644
--- a/pyrogram/types/user_and_chats/chat_permissions.py
+++ b/pyrogram/types/user_and_chats/chat_permissions.py
@@ -56,7 +56,7 @@ class ChatPermissions(Object):
can_manage_topics (``bool``, *optional*):
True, if the user is allowed to create, rename, close, and reopen forum topics.
- supergroups only.
+ Supergroups only.
"""
def __init__(
diff --git a/pyrogram/types/user_and_chats/chat_privileges.py b/pyrogram/types/user_and_chats/chat_privileges.py
index 3507614c..557c7edc 100644
--- a/pyrogram/types/user_and_chats/chat_privileges.py
+++ b/pyrogram/types/user_and_chats/chat_privileges.py
@@ -63,7 +63,7 @@ class ChatPrivileges(Object):
True, if the user is allowed to pin messages.
can_manage_topics (``bool``, *optional*):
- supergroups only.
+ Supergroups only.
True, if the user is allowed to create, rename, close, and reopen forum topics.
is_anonymous (``bool``, *optional*):
diff --git a/pyrogram/types/user_and_chats/peer_channel.py b/pyrogram/types/user_and_chats/peer_channel.py
deleted file mode 100644
index c8c8f6d7..00000000
--- a/pyrogram/types/user_and_chats/peer_channel.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
-# Copyright (C) 2017-present Dan
-#
-# 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 .
-
-from pyrogram import raw
-from ..object import Object
-
-
-class PeerChannel(Object):
- """A PeerChannel.
-
-
- Parameters:
- channel_id (``int``):
- Id of the channel.
- """
-
- def __init__(
- self, *,
- channel_id: int
- ):
- super().__init__()
-
- self.channel_id = channel_id
-
- @staticmethod
- def _parse(action: "raw.types.PeerChannel") -> "PeerChannel":
- return PeerChannel(
- channel_id=getattr(action, "channel_id", None)
- )
diff --git a/pyrogram/types/user_and_chats/peer_user.py b/pyrogram/types/user_and_chats/peer_user.py
deleted file mode 100644
index 2728e733..00000000
--- a/pyrogram/types/user_and_chats/peer_user.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
-# Copyright (C) 2017-present Dan
-#
-# 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 .
-
-from pyrogram import raw
-from ..object import Object
-
-
-class PeerUser(Object):
- """A PeerUser.
-
-
- Parameters:
- user_id (``int``):
- Id of the user.
- """
-
- def __init__(
- self, *,
- user_id: int
- ):
- super().__init__()
-
- self.user_id = user_id
-
- @staticmethod
- def _parse(action: "raw.types.PeerUser") -> "PeerUser":
- return PeerUser(
- user_id=getattr(action, "user_id", None)
- )