import { Collections , Structures } from 'detritus-client' ; import { GoogleLocales , UserFlags , UserPremiumTypes , NotSoApiKeys , } from '../../constants' ; import { BaseStructure } from './basestructure' ; const keysUser = new Collections . BaseSet < string > ( [ NotSoApiKeys . AVATAR , NotSoApiKeys . BLOCKED , NotSoApiKeys . BOT , NotSoApiKeys . DISCRIMINATOR , NotSoApiKeys . FLAGS , NotSoApiKeys . ID , NotSoApiKeys . LOCALE , NotSoApiKeys . USERNAME , NotSoApiKeys . PREMIUM_TYPE , ] ) ; export class User extends BaseStructure { readonly _keys = keysUser ; avatar : string | null = null ; blocked : boolean = false ; bot : boolean = false ; discriminator : string = '0000' ; flags : number = 0 ; id : string = '' ; locale : GoogleLocales | null = null ; username : string = '' ; premiumType : UserPremiumTypes = UserPremiumTypes . NONE ; constructor ( data ) { super ( ) ; this . merge ( data ) ; } hasOwner ( ) { return this . hasFlag ( UserFlags . OWNER ) ; } hasFlag ( flag ) { return ( this . flags & flag ) === flag ; } }