User
PartialUser
Represents a Partial User
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client |
Client
|
The client application that models may use for procedures. |
required |
id |
int
|
The unique ID of the user. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
client |
Client
|
The client application that models may use for procedures. |
id |
int
|
The unique ID of the user. |
Source code in dismake/models/user.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
mention
property
mention: str
Return a raw mention string for the user.
User
Bases: PartialUser
Represents a Discord user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
client |
Client
|
The client application that models may use for procedures. |
required |
data |
UserData
|
The data payload containing user information. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
username |
str
|
The username of the user. |
discriminator |
str
|
The discriminator of the user. (Legacy concept) |
global_name |
Optional[str]
|
The user's global nickname, taking precedence over the username in display. |
bot |
bool
|
Indicates whether the user is a bot account. |
system |
bool
|
Indicates whether the user represents Discord officially (system user). |
mfa_enabled |
bool
|
Indicates whether two-factor authentication is enabled for the user. |
accent_color |
Optional[Colortfgv]
|
The user's accent color if present; otherwise, None. |
locale |
str
|
The user's locale. |
verified |
bool
|
Indicates whether the user is verified. |
email |
Optional[str]
|
The user's email address, if available. |
flags |
UserFlag
|
Flags associated with the user. |
premium_type |
PremiumType
|
The user's premium type. |
avatar_decoration |
str
|
The hash of the user's avatar decoration. |
Operations
-
x == y: Checks if two users are equal. -
x != y: Checks if two users are not equal. -
str(x): Returns the username.
Source code in dismake/models/user.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
avatar
property
avatar: Optional[Asset]
Returns an Asset for the avatar the user has.
If the user has not uploaded a global avatar, None is returned.
banner
property
banner: Optional[Asset]
Returns the user's banner asset, if available.
default_avatar
property
default_avatar: Asset
Returns the default avatar for a given user.
display_avatar
property
display_avatar: Asset
Returns the user's display avatar.
For regular users this is just their default avatar or uploaded avatar.
PublicUserFlags
Bases: IntFlag
The known user flags that represent account badges.
Source code in dismake/models/user.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
ACTIVE_DEVELOPER
class-attribute
instance-attribute
ACTIVE_DEVELOPER = 1 << 22
User is an active bot developer.
BOT_HTTP_INTERACTIONS
class-attribute
instance-attribute
BOT_HTTP_INTERACTIONS = 1 << 19
Bot uses only HTTP interactions and is shown in the active member list.
BUG_HUNTER_LEVEL_1
class-attribute
instance-attribute
BUG_HUNTER_LEVEL_1 = 1 << 3
Bug Hunter Level 1.
BUG_HUNTER_LEVEL_2
class-attribute
instance-attribute
BUG_HUNTER_LEVEL_2 = 1 << 14
Bug Hunter Level 2.
DISCORD_CERTIFIED_MODERATOR
class-attribute
instance-attribute
DISCORD_CERTIFIED_MODERATOR = 1 << 18
Discord Certified Moderator.
DISCORD_EMPLOYEE
class-attribute
instance-attribute
DISCORD_EMPLOYEE = 1 << 0
Discord Employee.
EARLY_SUPPORTER
class-attribute
instance-attribute
EARLY_SUPPORTER = 1 << 9
Early Supporter.
EARLY_VERIFIED_DEVELOPER
class-attribute
instance-attribute
EARLY_VERIFIED_DEVELOPER = 1 << 17
Early verified Bot Developer.
Only applies to users that verified their account before 20th August 2019.
HYPESQUAD_BALANCE
class-attribute
instance-attribute
HYPESQUAD_BALANCE = 1 << 8
House of Balance.
HYPESQUAD_BRAVERY
class-attribute
instance-attribute
HYPESQUAD_BRAVERY = 1 << 6
House of Bravery.
HYPESQUAD_BRILLIANCE
class-attribute
instance-attribute
HYPESQUAD_BRILLIANCE = 1 << 7
House of Brilliance.
HYPESQUAD_EVENTS
class-attribute
instance-attribute
HYPESQUAD_EVENTS = 1 << 2
HypeSquad Events.
NONE
class-attribute
instance-attribute
NONE = 0
None.
PARTNERED_SERVER_OWNER
class-attribute
instance-attribute
PARTNERED_SERVER_OWNER = 1 << 1
Owner of a partnered Discord server.
TEAM_USER
class-attribute
instance-attribute
TEAM_USER = 1 << 10
Team user.
VERIFIED_BOT
class-attribute
instance-attribute
VERIFIED_BOT = 1 << 16
Verified Bot.
PremiumType
Bases: IntEnum
The types of Nitro.
Source code in dismake/models/user.py
73 74 75 76 77 78 79 80 81 82 83 | |
NITRO
class-attribute
instance-attribute
NITRO = 2
Premium including all perks (e.g. 2 server boosts).
NITRO_CLASSIC
class-attribute
instance-attribute
NITRO_CLASSIC = 1
Premium including basic perks like animated emojis and avatars.
NONE
class-attribute
instance-attribute
NONE = 0
No premium.