Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClientUser

Hierarchy

Index

Constructors

Properties

client: Client

The client that instantiated this structure

data: APIUser

Raw User data

Accessors

  • get accentColor(): undefined | null | number
  • The base 10 accent color of the user's banner

    Returns undefined | null | number

  • get avatar(): null | string
  • The user avatar's hash

    Returns null | string

  • get banner(): undefined | null | string
  • The user banner's hash

    Returns undefined | null | string

  • get bot(): boolean
  • Whether or not the user is a bot

    Returns boolean

  • get createdAt(): Date
  • The time the user was created at

    Returns Date

  • get createdTimestamp(): number
  • The timestamp the user was created at

    Returns number

  • get discriminator(): string
  • The discriminator of the user

    Returns string

  • get dmChannel(): undefined | Channel
  • The DMChannel between the client's user and this user

    Returns undefined | Channel

  • Returns UserFlagsBitField

  • get id(): string
  • The user's Id

    Returns string

  • get system(): undefined | boolean
  • Whether the user is an Official Discord System user (part of the urgent message system)

    Returns undefined | boolean

  • get tag(): null | string
  • The Discord "tag" (e.g. Veric#2755) for this user

    Returns null | string

  • get username(): string
  • The username of the user

    Returns string

  • get verified(): undefined | boolean
  • Whether or not the user is verified

    Returns undefined | boolean

Methods

  • A link to the user's avatar

    Parameters

    Returns null | string

  • A link to the user's banner

    Parameters

    Returns null | string

  • clone(): any
  • Returns any

  • A link to the user's avatar if they have one. Otherwise a link to their default avatar will be returned

    Parameters

    Returns null | string

  • fetch(): Promise<User>
  • Fetches this user

    Returns Promise<User>

  • Sends a message to this user

    example
    const { Embed } = require('helly');
    const embed = new Embed().setTitle('Pong!')
    user.send({ embeds: [embed] })
    example
    const { Embed } = require('helly');
    const embed = new Embed().setTitle('Pong!')
    user.send({ content: 'Ping?', embeds: [embed] })
    example
    user.send('Hello world!')
    

    Parameters

    Returns Promise<Message>

  • setAFK(afk?: boolean): void
  • Sets/removes the AFK flag for the client user This will clear your activity and status!

    example
    client.user.setAFK(true);
    
    example
    client.user.setAFK(false);
    

    Parameters

    • afk: boolean = true

    Returns void

  • Sets the activity the client user is playing This will set the status to Online and set the AFK to false!

    example
    client.user.setActivity({ name: 'with Helly', type: ActivityType.Playing });
    
    example
    client.user.setActivity({ name: 'with Helly', type: 1 });
    

    Parameters

    Returns void

  • Sets the presence of the client user

    example
    client.user.setPresence({ status: PresenceUpdateStatus.Online, activities: [{ name: 'Minecraft' }], afk: false });
    
    example
    client.user.setPresence({ status: 'idle', activities: [{ name: 'Games' }] });
    

    Parameters

    Returns void

  • Sets the status of the client user This will clear your activity and set the AFK to false!

    example
    client.user.setStatus(PresenceUpdateStatus.Online);
    
    example
    client.user.setStatus('idle');
    

    Parameters

    Returns void

  • toString(): string
  • Returns the mention of the user

    Returns string

Generated using TypeDoc version 0.22.16, the 9/16/2022 at 1:09:15 AM