|
|
@ -28,9 +28,14 @@ pub struct User {
|
|
|
|
#[serde(deserialize_with = "deserialize_discriminator")]
|
|
|
|
#[serde(deserialize_with = "deserialize_discriminator")]
|
|
|
|
pub discriminator: u16,
|
|
|
|
pub discriminator: u16,
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
pub avatar: Option<String>,
|
|
|
|
|
|
|
|
#[serde(default = "default_deleted")]
|
|
|
|
pub deleted: bool,
|
|
|
|
pub deleted: bool,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn default_deleted() -> bool {
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl Username for User {
|
|
|
|
impl Username for User {
|
|
|
|
fn username(&self) -> String {
|
|
|
|
fn username(&self) -> String {
|
|
|
|
if self.discriminator == 0 {
|
|
|
|
if self.discriminator == 0 {
|
|
|
|