Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

feat: update user.pyi #590

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Changes from all commits
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
35 changes: 21 additions & 14 deletions naff/models/discord/user.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from naff.models.discord.role import Role
from naff.models.discord.snowflake import Snowflake_Type
from naff.models.discord.timestamp import Timestamp
from naff.models.discord.voice_state import VoiceState
from typing import List, Optional, Union, Set
from typing import Iterable, List, Optional, Union, Set

class _SendDMMixin(SendMixin):
id: Snowflake_Type
Expand All @@ -31,21 +31,21 @@ class BaseUser(DiscordObject, _SendDMMixin):
@property
def display_avatar(self) -> Asset: ...
async def fetch_dm(self) -> DM: ...
def get_dm(self) -> Optional[DM]: ...
def get_dm(self) -> Optional["DM"]: ...
@property
def mutual_guilds(self) -> List[Guild]: ...
def mutual_guilds(self) -> List["Guild"]: ...

class User(BaseUser):
bot: bool
system: bool
public_flags: UserFlags
premium_type: PremiumTypes
banner: Optional[Asset]
accent_color: Optional[Color]
banner: Optional["Asset"]
accent_color: Optional["Color"]
activities: list[Activity]
status: Absent[Status]
@property
def member_instances(self) -> List[Member]: ...
def member_instances(self) -> List["Member"]: ...

class NaffUser(User):
verified: bool
Expand All @@ -56,15 +56,16 @@ class NaffUser(User):
flags: UserFlags
_guild_ids: Set[Snowflake_Type]
@property
def guilds(self) -> List[Guild]: ...
def guilds(self) -> List["Guild"]: ...
async def edit(self, username: Absent[str] = ..., avatar: Absent[UPLOADABLE_TYPE] = ...) -> None: ...

class Member(User): # for typehinting purposes, we can lie
bot: bool
nick: Optional[str]
deaf: bool
mute: bool
joined_at: Timestamp
premium_since: Optional[Timestamp]
premium_since: Optional["Timestamp"]
pending: Optional[bool]
guild_avatar: Asset
communication_disabled_until: Optional[Timestamp]
Expand All @@ -80,36 +81,42 @@ class Member(User): # for typehinting purposes, we can lie
@property
def guild(self) -> Guild: ...
@property
def roles(self) -> List[Role]: ...
def roles(self) -> List["Role"]: ...
@property
def top_role(self) -> Role: ...
@property
def display_name(self) -> str: ...
@property
def display_avatar(self) -> Asset: ...
@property
def premium(self) -> bool: ...
@property
def guild_permissions(self) -> Permissions: ...
@property
def voice(self) -> Optional[VoiceState]: ...
def voice(self) -> Optional["VoiceState"]: ...
def has_permission(self, *permissions: Permissions) -> bool: ...
def channel_permissions(self, channel: TYPE_GUILD_CHANNEL) -> Permissions: ...
async def edit_nickname(self, new_nickname: Absent[str] = ..., reason: Absent[str] = ...) -> None: ...
async def add_role(self, role: Union[Snowflake_Type, Role], reason: Absent[str] = ...) -> None: ...
async def add_roles(self, roles: Iterable[Union[Snowflake_Type, Role]], reason: Absent[str] = ...) -> None: ...
async def remove_role(self, role: Union[Snowflake_Type, Role], reason: Absent[str] = ...) -> None: ...
async def remove_roles(self, roles: Iterable[Union[Snowflake_Type, Role]], reason: Absent[str] = ...) -> None: ...
def has_role(self, *roles: Union[Snowflake_Type, Role]) -> bool: ...
async def timeout(
self, communication_disabled_until: Union[Timestamp, datetime, int, float, str, None], reason: Absent[str] = ...
self,
communication_disabled_until: Union["Timestamp", datetime, int, float, str, None],
reason: Absent[str] = ...,
) -> dict: ...
async def move(self, channel_id: Snowflake_Type) -> None: ...
async def edit(
self,
*,
nickname: Absent[str] = ...,
roles: Absent[list[Snowflake_Type]] = ...,
roles: Absent[Iterable["Snowflake_Type"]] = ...,
mute: Absent[bool] = ...,
deaf: Absent[bool] = ...,
channel_id: Absent[Snowflake_Type] = ...,
communication_disabled_until: Absent[Union[Timestamp, None]] = ...,
channel_id: Absent["Snowflake_Type"] = ...,
communication_disabled_until: Absent[Union["Timestamp", None]] = ...,
reason: Absent[str] = ...,
) -> None: ...
async def kick(self, reason: Absent[str] = ...) -> None: ...
Expand Down