From 6fc5f4e916b2ec245f0836eb36fed9927a0750ce Mon Sep 17 00:00:00 2001 From: Riley Winkler Date: Wed, 12 Feb 2025 20:24:53 -0600 Subject: [PATCH] Add types --- HeliosBackend/types/__init__.py | 1 + HeliosBackend/types/discord_types.py | 37 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 HeliosBackend/types/__init__.py create mode 100644 HeliosBackend/types/discord_types.py diff --git a/HeliosBackend/types/__init__.py b/HeliosBackend/types/__init__.py new file mode 100644 index 0000000..f55e800 --- /dev/null +++ b/HeliosBackend/types/__init__.py @@ -0,0 +1 @@ +from .discord_types import * \ No newline at end of file diff --git a/HeliosBackend/types/discord_types.py b/HeliosBackend/types/discord_types.py new file mode 100644 index 0000000..824d4e3 --- /dev/null +++ b/HeliosBackend/types/discord_types.py @@ -0,0 +1,37 @@ +from typing import TypedDict, Optional + + +__all__ = ( + 'UserType', + 'Application', + 'AuthenticateResponse', +) + + +class UserType(TypedDict): + username: str + discriminator: str + id: str + avatar: Optional[str] + public_flags: int + global_name: Optional[str] + bot: bool + flags: Optional[int] + premium_type: Optional[int] + nickname: Optional[str] + + +class Application(TypedDict): + description: str + icon: Optional[str] + id: str + rpc_origins: list[str] + name: str + + +class AuthenticateResponse(TypedDict): + access_token: str + user: UserType + scopes: list[str] + expires: str + application: Application \ No newline at end of file