Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: enable annotations future import and lint
  • Loading branch information
alissonlauffer committed Jun 30, 2024
commit 3c773f931a940347ddc4f2ee1f92bb322a550235
4 changes: 2 additions & 2 deletions hydrogram/types/user_and_chats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

from .chat import Chat
from .chat_admin_with_invite_links import ChatAdminWithInviteLinks
from .chat_background import ChatBackground
from .chat_event import ChatEvent
from .chat_event_filter import ChatEventFilter
from .chat_invite_link import ChatInviteLink
Expand Down Expand Up @@ -50,11 +51,11 @@
from .video_chat_members_invited import VideoChatMembersInvited
from .video_chat_scheduled import VideoChatScheduled
from .video_chat_started import VideoChatStarted
from .chat_background import ChatBackground

__all__ = [
"Chat",
"ChatAdminWithInviteLinks",
"ChatBackground",
"ChatEvent",
"ChatEventFilter",
"ChatInviteLink",
Expand Down Expand Up @@ -86,5 +87,4 @@
"VideoChatMembersInvited",
"VideoChatScheduled",
"VideoChatStarted",
"ChatBackground",
]
19 changes: 11 additions & 8 deletions hydrogram/types/user_and_chats/chat_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.

from datetime import datetime
from typing import List
from __future__ import annotations

from typing import TYPE_CHECKING

import hydrogram
from hydrogram import raw, utils
from hydrogram import types
from hydrogram import raw, types, utils
from hydrogram.file_id import (
FileId,
FileType,
Expand All @@ -31,6 +31,9 @@
)
from hydrogram.types.object import Object

if TYPE_CHECKING:
from datetime import datetime


class ChatBackground(Object):
"""Describes a background set for a specific chat.
Expand Down Expand Up @@ -64,13 +67,13 @@ class ChatBackground(Object):
def __init__(
self,
*,
client: "hydrogram.Client" = None,
client: hydrogram.Client = None,
file_id: str,
file_unique_id: str,
file_size: int,
date: datetime,
slug: str,
thumbs: List["types.Thumbnail"] = None,
thumbs: list[types.Thumbnail] | None = None,
):
super().__init__(client)

Expand All @@ -88,8 +91,8 @@ def link(self) -> str:
@staticmethod
def _parse(
client,
wallpaper: "raw.types.Wallpaper",
) -> "ChatBackground":
wallpaper: raw.types.Wallpaper,
) -> ChatBackground:
return ChatBackground(
file_id=FileId(
dc_id=wallpaper.document.dc_id,
Expand Down