📚
YAGPDB
  • YAGPDB Coding System - Documentation
  • Getting Started
  • Useful Functions
  • Primary Level
    • The Dot and Variables
      • User
      • Guild / Server
      • Member
      • Channel
      • Message
      • Reaction
      • Time
    • Custom Types
    • Functions
      • Type Conversion
      • String Manipulation
      • Math Functions
      • Message Functions
      • Mentions
      • Role Functions
      • Current User
      • Miscellaneous
      • ExecCC
    • Conditional Branching
  • Intermediate Level
  • Database
  • Range Action
  • With Action
  • Custom Embeds
  • Advanced Level
    • Using RegEx
  • Custom Commands Examples
    • Texas Hold'em
Powered by GitBook
On this page
  • Field
  • Function

Was this helpful?

  1. Primary Level
  2. The Dot and Variables

User

You are the user; the user is you

PreviousThe Dot and VariablesNextGuild / Server

Last updated 3 years ago

Was this helpful?

Field

Field

Description

.User

The user's username together with discriminator.

.User.String

The user's username together with discriminator as string type.

.User.Username

The user's username.

.User.ID

The user's ID.

.User.Discriminator

The user's discriminator (The four digits after a person's username).

.User.Avatar

The user's avatar ID.

.User.AvatarURL "256"

Gives the URL for user's avatar, argument "256" is the size of the picture and can increase/decrease twofold (e.g. 512, 1024 or 128, 64 etc.).

.User.Bot

Determines whether the target user is a bot - if yes, it will return True.

.User.Mention

Mentions user.

Function

Function

Description

userArg mention/userID

Function that can be used to retrieve.User object from a mention or userID.

{{(userArg .User.ID).Mention}} mentions triggering user.

pastUsernames userID offset

Returns a slice of type [ ]*logs.CCNameChange having fields .Name and .Time of previous 15 usernames and skips offset number in that list.

{{range pastUsernames .User.ID 0}} {{.Name}} - {{.Time.Format "Jan _2 2006"}} {{end}}

pastNicknames userID offset

Same as pastUsernames.

User object in Discord documentation (read it if you want to want to write complex codes).