Repository: Rapptz/discord.py
File: discord/app_commands/models.py (Python)

Code before:
        '_applied_tags',
        '_flags',
        '_created_at',
        '_state',
    )

    def __init__(
        self,
        *,
        state: ConnectionState,
        data: PartialThread,
        guild_id: int,
    ):
        self._state: ConnectionState = state
        self.guild_id: int = guild_id
        self.id: int = int(data['id'])
        self.parent_id: int = int(data['parent_id'])
        self.type: ChannelType = try_enum(ChannelType, data['type'])
        self.name: str = data['name']
        self.permissions: Permissions = Permissions(int(data['permissions']))
        self.owner_id: int = int(data['owner_id'])
        self.member_count: int = int(data['member_count'])
        self.message_count: int = int(data['message_count'])
        self.last_message_id: Optional[int] = _get_as_snowflake(data, 'last_message_id')
        self.slowmode_delay: int = data.get('rate_limit_per_user', 0)
        self.total_message_sent: int = data.get('total_message_sent')
        self._applied_tags: array.array[int] = array.array('Q', map(int, data.get('applied_tags', [])))
        self._flags: int = data.get('flags', 0)
        self._unroll_metadata(data['thread_metadata'])

    def __str__(self) -> str:
        return self.name

    def __repr__(self) -> str:
        return f'<{self.__class__.__name__} id={self.id!r} name={self.name!r} archived={self.archived} type={self.type!r}>'

    @property
    def guild(self) -> Optional[Guild]:
        """Optional[:class:`~discord.Guild`]: The channel's guild, from cache, if found."""
        return self._state._get_guild(self.guild_id)

    def _unroll_metadata(self, data: ThreadMetadata) -> None:
        self.archived: bool = data['archived']
        self.archiver_id: Optional[int] = _get_as_snowflake(data, 'archiver_id')
        self.auto_archive_duration: ThreadArchiveDuration = data['auto_archive_duration']
        self.archive_timestamp: datetime = parse_time(data['archive_timestamp'])
        self.locked: bool = data.get('locked', False)
        self.invitable: bool = data.get('invitable', True)
        self._created_at: Optional[datetime] = parse_time(data.get('create_timestamp'))

    @property

Review comment (suggestion):
```suggestion
        self.total_message_sent: int = data.get('total_message_sent', 0)
```
saner default

Code after:
        '_applied_tags',
        '_flags',
        '_created_at',
        '_state',
    )

    def __init__(
        self,
        *,
        state: ConnectionState,
        data: PartialThread,
        guild_id: int,
    ):
        self._state: ConnectionState = state
        self.guild_id: int = guild_id
        self.id: int = int(data['id'])
        self.parent_id: int = int(data['parent_id'])
        self.type: ChannelType = try_enum(ChannelType, data['type'])
        self.name: str = data['name']
        self.permissions: Permissions = Permissions(int(data['permissions']))
        self.owner_id: int = int(data['owner_id'])
        self.member_count: int = int(data['member_count'])
        self.message_count: int = int(data['message_count'])
        self.last_message_id: Optional[int] = _get_as_snowflake(data, 'last_message_id')
        self.slowmode_delay: int = data.get('rate_limit_per_user', 0)
        self.total_message_sent: int = data.get('total_message_sent', 0)
        self._applied_tags: array.array[int] = array.array('Q', map(int, data.get('applied_tags', [])))
        self._flags: int = data.get('flags', 0)
        self._unroll_metadata(data['thread_metadata'])

    def __str__(self) -> str:
        return self.name

    def __repr__(self) -> str:
        return f'<{self.__class__.__name__} id={self.id!r} name={self.name!r} archived={self.archived} type={self.type!r}>'

    @property
    def guild(self) -> Optional[Guild]:
        """Optional[:class:`~discord.Guild`]: The channel's guild, from cache, if found."""
        return self._state._get_guild(self.guild_id)

    def _unroll_metadata(self, data: ThreadMetadata) -> None:
        self.archived: bool = data['archived']
        self.archiver_id: Optional[int] = _get_as_snowflake(data, 'archiver_id')
        self.auto_archive_duration: ThreadArchiveDuration = data['auto_archive_duration']
        self.archive_timestamp: datetime = parse_time(data['archive_timestamp'])
        self.locked: bool = data.get('locked', False)
        self.invitable: bool = data.get('invitable', True)
        self._created_at: Optional[datetime] = parse_time(data.get('create_timestamp'))

    @property