mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-03 14:02:19 +00:00
Fix remaining type errors in main package
This doesn't fix the type errors in the ext packages though.
This commit is contained in:
@@ -72,7 +72,7 @@ if TYPE_CHECKING:
|
||||
from .types.snowflake import Snowflake
|
||||
from .types.activity import Activity as ActivityPayload
|
||||
from .types.channel import DMChannel as DMChannelPayload
|
||||
from .types.user import User as UserPayload
|
||||
from .types.user import User as UserPayload, PartialUser as PartialUserPayload
|
||||
from .types.emoji import Emoji as EmojiPayload
|
||||
from .types.sticker import GuildSticker as GuildStickerPayload
|
||||
from .types.guild import Guild as GuildPayload
|
||||
@@ -314,7 +314,7 @@ class ConnectionState:
|
||||
for vc in self.voice_clients:
|
||||
vc.main_ws = ws # type: ignore - Silencing the unknown attribute (ok at runtime).
|
||||
|
||||
def store_user(self, data):
|
||||
def store_user(self, data: Union[UserPayload, PartialUserPayload]) -> User:
|
||||
# this way is 300% faster than `dict.setdefault`.
|
||||
user_id = int(data['id'])
|
||||
try:
|
||||
@@ -328,7 +328,7 @@ class ConnectionState:
|
||||
def store_user_no_intents(self, data):
|
||||
return User(state=self, data=data)
|
||||
|
||||
def create_user(self, data: UserPayload) -> User:
|
||||
def create_user(self, data: Union[UserPayload, PartialUserPayload]) -> User:
|
||||
return User(state=self, data=data)
|
||||
|
||||
def get_user(self, id):
|
||||
|
||||
Reference in New Issue
Block a user