1
|
|
|
""" |
2
|
|
|
The MIT License (MIT) |
3
|
|
|
Copyright (c) 2015-present Rapptz |
4
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a |
5
|
|
|
copy of this software and associated documentation files (the "Software"), |
6
|
|
|
to deal in the Software without restriction, including without limitation |
7
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
8
|
|
|
and/or sell copies of the Software, and to permit persons to whom the |
9
|
|
|
Software is furnished to do so, subject to the following conditions: |
10
|
|
|
The above copyright notice and this permission notice shall be included in |
11
|
|
|
all copies or substantial portions of the Software. |
12
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
13
|
|
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
14
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
15
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
16
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
17
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
18
|
|
|
DEALINGS IN THE SOFTWARE. |
19
|
|
|
""" |
20
|
|
|
|
21
|
|
|
from .snowflake import Snowflake |
22
|
|
|
from typing import Literal, Optional, TypedDict |
23
|
|
|
|
24
|
|
|
|
25
|
|
|
class PartialUser(TypedDict): |
26
|
|
|
id: Snowflake |
27
|
|
|
username: str |
28
|
|
|
discriminator: str |
29
|
|
|
avatar: Optional[str] |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
PremiumType = Literal[0, 1, 2] |
33
|
|
|
|
34
|
|
|
|
35
|
|
|
class User(PartialUser, total=False): |
36
|
|
|
bot: bool |
37
|
|
|
system: bool |
38
|
|
|
mfa_enabled: bool |
39
|
|
|
local: str |
40
|
|
|
verified: bool |
41
|
|
|
email: Optional[str] |
42
|
|
|
flags: int |
43
|
|
|
premium_type: PremiumType |
44
|
|
|
public_flags: int |