From 20d387129071bc3bac854e6b8344b885e280587d Mon Sep 17 00:00:00 2001
From: Harshal Laheri <73422191+Harshal6927@users.noreply.github.com>
Date: Fri, 15 Jul 2022 09:45:42 +0530
Subject: [PATCH] Add return type hint for some functions

---
 discord/sticker.py        |  2 +-
 discord/team.py           |  4 ++--
 discord/template.py       | 10 +++++-----
 discord/utils.py          |  8 ++++----
 discord/voice_client.py   |  2 +-
 discord/welcome_screen.py |  6 ++++--
 6 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/discord/sticker.py b/discord/sticker.py
index f783d3bf5..dc20faf60 100644
--- a/discord/sticker.py
+++ b/discord/sticker.py
@@ -198,7 +198,7 @@ class StickerItem(_StickerTag):
 
     __slots__ = ('_state', 'name', 'id', 'format', 'url')
 
-    def __init__(self, *, state: ConnectionState, data: StickerItemPayload):
+    def __init__(self, *, state: ConnectionState, data: StickerItemPayload) -> None:
         self._state: ConnectionState = state
         self.name: str = data['name']
         self.id: int = int(data['id'])
diff --git a/discord/team.py b/discord/team.py
index cf9d1fc10..eef2c2d81 100644
--- a/discord/team.py
+++ b/discord/team.py
@@ -64,7 +64,7 @@ class Team:
 
     __slots__ = ('_state', 'id', 'name', '_icon', 'owner_id', 'members')
 
-    def __init__(self, state: ConnectionState, data: TeamPayload):
+    def __init__(self, state: ConnectionState, data: TeamPayload) -> None:
         self._state: ConnectionState = state
 
         self.id: int = int(data['id'])
@@ -130,7 +130,7 @@ class TeamMember(BaseUser):
 
     __slots__ = ('team', 'membership_state', 'permissions')
 
-    def __init__(self, team: Team, state: ConnectionState, data: TeamMemberPayload):
+    def __init__(self, team: Team, state: ConnectionState, data: TeamMemberPayload) -> None:
         self.team: Team = team
         self.membership_state: TeamMembershipState = try_enum(TeamMembershipState, data['membership_state'])
         self.permissions: List[str] = data['permissions']
diff --git a/discord/template.py b/discord/template.py
index 02b7d2e10..e420e537c 100644
--- a/discord/template.py
+++ b/discord/template.py
@@ -49,7 +49,7 @@ class _FriendlyHttpAttributeErrorHelper:
 
 
 class _PartialTemplateState:
-    def __init__(self, *, state):
+    def __init__(self, *, state) -> None:
         self.__state = state
         self.http = _FriendlyHttpAttributeErrorHelper()
 
@@ -69,19 +69,19 @@ class _PartialTemplateState:
     def member_cache_flags(self):
         return self.__state.member_cache_flags
 
-    def store_emoji(self, guild, packet):
+    def store_emoji(self, guild, packet) -> None:
         return None
 
-    def _get_voice_client(self, id):
+    def _get_voice_client(self, id) -> None:
         return None
 
-    def _get_message(self, id):
+    def _get_message(self, id) -> None:
         return None
 
     def _get_guild(self, id):
         return self.__state._get_guild(id)
 
-    async def query_members(self, **kwargs: Any):
+    async def query_members(self, **kwargs: Any) -> list:
         return []
 
     def __getattr__(self, attr):
diff --git a/discord/utils.py b/discord/utils.py
index 69041ffcc..0cc39ff53 100644
--- a/discord/utils.py
+++ b/discord/utils.py
@@ -98,13 +98,13 @@ DISCORD_EPOCH = 1420070400000
 class _MissingSentinel:
     __slots__ = ()
 
-    def __eq__(self, other):
+    def __eq__(self, other) -> bool:
         return False
 
-    def __bool__(self):
+    def __bool__(self) -> bool:
         return False
 
-    def __hash__(self):
+    def __hash__(self) -> int:
         return 0
 
     def __repr__(self):
@@ -115,7 +115,7 @@ MISSING: Any = _MissingSentinel()
 
 
 class _cached_property:
-    def __init__(self, function):
+    def __init__(self, function) -> None:
         self.function = function
         self.__doc__ = getattr(function, '__doc__')
 
diff --git a/discord/voice_client.py b/discord/voice_client.py
index 093c6270e..6b4717f20 100644
--- a/discord/voice_client.py
+++ b/discord/voice_client.py
@@ -233,7 +233,7 @@ class VoiceClient(VoiceProtocol):
     secret_key: List[int]
     ssrc: int
 
-    def __init__(self, client: Client, channel: abc.Connectable):
+    def __init__(self, client: Client, channel: abc.Connectable) -> None:
         if not has_nacl:
             raise RuntimeError("PyNaCl library needed in order to use voice")
 
diff --git a/discord/welcome_screen.py b/discord/welcome_screen.py
index 15fa75dc6..f834ffe9e 100644
--- a/discord/welcome_screen.py
+++ b/discord/welcome_screen.py
@@ -62,7 +62,9 @@ class WelcomeChannel:
         The emoji used beside the channel description.
     """
 
-    def __init__(self, *, channel: Snowflake, description: str, emoji: Optional[Union[PartialEmoji, Emoji, str]] = None):
+    def __init__(
+        self, *, channel: Snowflake, description: str, emoji: Optional[Union[PartialEmoji, Emoji, str]] = None
+    ) -> None:
         self.channel = channel
         self.description = description
         self.emoji = emoji
@@ -120,7 +122,7 @@ class WelcomeScreen:
         The channels shown on the welcome screen.
     """
 
-    def __init__(self, *, data: WelcomeScreenPayload, guild: Guild):
+    def __init__(self, *, data: WelcomeScreenPayload, guild: Guild) -> None:
         self._state = guild._state
         self._guild = guild
         self._store(data)