Skip to content

Commit

Permalink
Add some typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewthederp committed Apr 10, 2024
1 parent ea55ce1 commit add5b6d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions revolt/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .types import Server as ServerPayload
from .types import SystemMessagesConfig
from .types import Member as MemberPayload
from .types import Role as RolePayload

__all__ = ("Server", "SystemMessages", "ServerBan")

Expand Down Expand Up @@ -426,8 +427,8 @@ async def create_role(self, name: str) -> Role:
The role that was just created
"""
payload = await self.state.http.create_role(self.id, name)
role_id = payload["id"]
data = payload["role"]
role_id: str = payload["id"]

Check failure on line 430 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.9)

Type of "role_id" is partially unknown   Type of "role_id" is "Unknown | str" (reportUnknownVariableType)

Check failure on line 430 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.9)

Could not access item in TypedDict   "id" is not a defined key in "Role" (reportGeneralTypeIssues)

Check failure on line 430 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.10)

Type of "role_id" is partially unknown   Type of "role_id" is "Unknown | str" (reportUnknownVariableType)

Check failure on line 430 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.10)

Could not access item in TypedDict   "id" is not a defined key in "Role" (reportGeneralTypeIssues)
data: RolePayload = payload["role"]

Check failure on line 431 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.9)

Type of "data" is partially unknown   Type of "data" is "Unknown | Role" (reportUnknownVariableType)

Check failure on line 431 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.9)

Could not access item in TypedDict   "role" is not a defined key in "Role" (reportGeneralTypeIssues)

Check failure on line 431 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.10)

Type of "data" is partially unknown   Type of "data" is "Unknown | Role" (reportUnknownVariableType)

Check failure on line 431 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.10)

Could not access item in TypedDict   "role" is not a defined key in "Role" (reportGeneralTypeIssues)

return Role(data, role_id, self, self.state)

Check failure on line 433 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.9)

Argument type is partially unknown   Argument corresponds to parameter "data" in function "__init__"   Argument type is "Unknown | Role" (reportUnknownArgumentType)

Check failure on line 433 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.9)

Argument type is partially unknown   Argument corresponds to parameter "role_id" in function "__init__"   Argument type is "Unknown | str" (reportUnknownArgumentType)

Check failure on line 433 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.10)

Argument type is partially unknown   Argument corresponds to parameter "data" in function "__init__"   Argument type is "Unknown | Role" (reportUnknownArgumentType)

Check failure on line 433 in revolt/server.py

View workflow job for this annotation

GitHub Actions / pyright-type-checking (3.10)

Argument type is partially unknown   Argument corresponds to parameter "role_id" in function "__init__"   Argument type is "Unknown | str" (reportUnknownArgumentType)

Expand Down

0 comments on commit add5b6d

Please sign in to comment.