Sticker
        
        extends Part
    
    
            
            in package
            
        
    
            
            implements
                            Stringable                    
    
    
A sticker that can be sent in a Discord message.
Tags
Table of Contents
Interfaces
- Stringable
Constants
- FORMAT_TYPE_APNG = 2
- FORMAT_TYPE_GIF = 4
- FORMAT_TYPE_LOTTIE = 3
- FORMAT_TYPE_PNG = 1
- TYPE_GUILD = 2
- A sticker uploaded to a guild for the guild's members.
- TYPE_STANDARD = 1
- An official sticker in a pack.
Properties
- $available : bool|null
- $created : bool
- Is the part already created in the Discord servers?
- $description : string|null
- $format_type : int
- $guild : Guild|null
- $guild_id : string|null
- $id : string
- $name : string
- $pack_id : string|null
- $scriptData : mixed
- Custom script data.
- $sort_value : int|null
- $tags : array<string|int, mixed>
- $type : int
- $user : User|null
- $user_id : string|null
- $attributes : array<string|int, mixed>
- The parts attributes.
- $discord : Discord
- The Discord client.
- $factory : Factory
- The factory.
- $fillable : array<string|int, mixed>
- The parts fillable attributes.
- $hidden : array<string|int, mixed>
- Attributes that are hidden from debug info.
- $http : Http
- The HTTP client.
- $repositories : array<string|int, mixed>
- An array of repositories that can exist in a part.
- $repositories_cache : array<string|int, mixed>
- An array of repositories.
- $visible : array<string|int, mixed>
- Attributes which are visible from debug info.
Methods
- __construct() : mixed
- Create a new part instance.
- __debugInfo() : array<string|int, mixed>
- __get() : mixed
- Handles dynamic get calls onto the part.
- __serialize() : array<string|int, mixed>
- __set() : void
- Handles dynamic set calls onto the part.
- __toString() : string
- Returns the URL for the sticker.
- __unserialize() : void
- fetch() : PromiseInterface<string|int, static>
- Fetches any missing information about the part from Discord's servers.
- fill() : void
- Fills the parts attributes from an array.
- getConstants() : array<string|int, mixed>
- Returns an array of constant names and their values.
- getCreatableAttributes() : array<string|int, mixed>
- Returns the attributes needed to create.
- getDiscord() : Discord
- Get the Discord instance that owns this Part.
- getPublicAttributes() : array<string|int, mixed>
- Returns an array of public attributes.
- getRawAttributes() : array<string|int, mixed>
- Returns an array of raw attributes.
- getRepositoryAttributes() : array<string|int, mixed>
- getUpdatableAttributes() : array<string|int, mixed>
- isPartial() : bool
- jsonSerialize() : array<string|int, mixed>
- Provides data when the part is encoded into JSON. Used for JsonSerializable.
- offsetExists() : bool
- Checks if an attribute exists via key. Used for ArrayAccess.
- offsetGet() : mixed
- Gets an attribute via key. Used for ArrayAccess.
- offsetSet() : void
- Sets an attribute via key. Used for ArrayAccess.
- offsetUnset() : void
- Unsets an attribute via key. Used for ArrayAccess.
- save() : PromiseInterface
- serialize() : string|null
- Serializes the data. Used for Serializable.
- unserialize() : void
- Unserializes some data and stores it. Used for Serializable.
- afterConstruct() : void
- Called after the part has been constructed.
- attributeCarbonHelper() : Carbon|null
- Helps with getting ISO8601 timestamp attributes.
- attributeCollectionHelper() : ExCollectionInterface
- Helps with getting Part attributes.
- attributePartHelper() : Part|null
- Helps with getting Part attributes.
- attributeTypedCollectionHelper() : ExCollectionInterface
- Helps with getting Part attributes for classes with extended types.
- checkForGetMutator() : string|false
- Checks if there is a get mutator present.
- checkForSetMutator() : string|false
- Checks if there is a set mutator present.
- getAttribute() : mixed
- Gets an attribute on the part.
- getGuildAttribute() : Guild|null
- Returns the guild attribute.
- getTagsAttribute() : array<string|int, mixed>
- Returns the tags attribute.
- getUserAttribute() : User|null
- Gets the user that created the sticker.
- getUserIdAttribute() : string|null
- Returns the user_id attribute.
- makeOptionalAttributes() : array<string|int, mixed>
- Return key-value attributes if it has been filled.
- setAttribute() : void
- Sets an attribute on the part.
- studly() : string
- Converts a string to studlyCase.
Constants
FORMAT_TYPE_APNG
    public
        mixed
    FORMAT_TYPE_APNG
    = 2
    
    
    
    
FORMAT_TYPE_GIF
    public
        mixed
    FORMAT_TYPE_GIF
    = 4
    
    
    
    
FORMAT_TYPE_LOTTIE
    public
        mixed
    FORMAT_TYPE_LOTTIE
    = 3
    
    
    
    
FORMAT_TYPE_PNG
    public
        mixed
    FORMAT_TYPE_PNG
    = 1
    
    
    
    
TYPE_GUILD
A sticker uploaded to a guild for the guild's members.
    public
        mixed
    TYPE_GUILD
    = 2
    
    
    
    
TYPE_STANDARD
An official sticker in a pack.
    public
        mixed
    TYPE_STANDARD
    = 1
    
    
    
    
Properties
$available
        public
            bool|null
    $available
    
        Whether this guild sticker can be used, may be false due to loss of Server Boosts.
$created
Is the part already created in the Discord servers?
        public
            bool
    $created
     = false
    
        Whether the part has been created.
$description
        public
            string|null
    $description
    
        The description of the sticker.
$format_type
        public
            int
    $format_type
    
        The type of sticker format.
$guild read-only
        public
            Guild|null
    $guild
    
        The guild that owns the sticker.
$guild_id
        public
            string|null
    $guild_id
    
        The identifier of the guild that owns the sticker.
$id
        public
            string
    $id
    
        The identifier for the sticker.
$name
        public
            string
    $name
    
        The name of the sticker.
$pack_id
        public
            string|null
    $pack_id
    
        For standard stickers, id of the pack the sticker is from.
$scriptData
Custom script data.
Relying on this variable with dynamic caching is discouraged.
        public
            mixed
    $scriptData
    
        Used for storing custom information, used by end products.
$sort_value
        public
            int|null
    $sort_value
    
        The standard sticker's sort order within its pack.
$tags
        public
            array<string|int, mixed>
    $tags
    
        Autocomplete/suggestion tags for the sticker (max 200 characters).
$type
        public
            int
    $type
    
        The type of sticker.
$user
        public
            User|null
    $user
    
        The user that uploaded the guild sticker.
$user_id read-only
        public
            string|null
    $user_id
    
        The identifier of the user that uploaded the guild sticker.
$attributes
The parts attributes.
        protected
            array<string|int, mixed>
    $attributes
     = []
    
        The parts attributes and content.
$discord
The Discord client.
        protected
            Discord
    $discord
    
    
        Client.
$factory
The factory.
        protected
            Factory
    $factory
    
    
        Factory.
$fillable
The parts fillable attributes.
        protected
            array<string|int, mixed>
    $fillable
     = ['id', 'name', 'tags', 'type', 'format_type', 'description', 'pack_id', 'sort_value', 'available', 'guild_id', 'user']
    
        The array of attributes that can be mass-assigned.
Tags
$hidden
Attributes that are hidden from debug info.
        protected
            array<string|int, mixed>
    $hidden
     = []
    
        Attributes that are hidden from public.
$http
The HTTP client.
        protected
            Http
    $http
    
    
        Client.
$repositories
An array of repositories that can exist in a part.
        protected
            array<string|int, mixed>
    $repositories
     = []
    
        Repositories.
$repositories_cache
An array of repositories.
        protected
            array<string|int, mixed>
    $repositories_cache
     = []
    
    
    
    
    
$visible
Attributes which are visible from debug info.
        protected
            array<string|int, mixed>
    $visible
     = []
    
    
    
    
    
Methods
__construct()
Create a new part instance.
    public
                    __construct(Discord $discord[, array<string|int, mixed> $attributes = [] ][, bool $created = false ]) : mixed
    Parameters
- $discord : Discord
- 
                    The Discord client. 
- $attributes : array<string|int, mixed> = []
- 
                    An array of attributes to build the part. 
- $created : bool = false
- 
                    Whether the part has already been created. 
__debugInfo()
    public
                    __debugInfo() : array<string|int, mixed>
    Return values
array<string|int, mixed>__get()
Handles dynamic get calls onto the part.
    public
                    __get(string $key) : mixed
    Parameters
- $key : string
- 
                    The attributes key. 
Tags
Return values
mixed —The value of the attribute.
__serialize()
    public
                    __serialize() : array<string|int, mixed>
    Return values
array<string|int, mixed>__set()
Handles dynamic set calls onto the part.
    public
                    __set(string $key, mixed $value) : void
    Parameters
- $key : string
- 
                    The attributes key. 
- $value : mixed
- 
                    The attributes value. 
Tags
__toString()
Returns the URL for the sticker.
    public
                    __toString() : string
    Return values
string —The URL to the sticker.
__unserialize()
    public
                    __unserialize(array<string|int, mixed> $data) : void
    Parameters
- $data : array<string|int, mixed>
fetch()
Fetches any missing information about the part from Discord's servers.
    public
                    fetch() : PromiseInterface<string|int, static>
    Tags
Return values
PromiseInterface<string|int, static>fill()
Fills the parts attributes from an array.
    public
                    fill(array<string|int, mixed> $attributes) : void
    Parameters
- $attributes : array<string|int, mixed>
- 
                    An array of attributes to build the part. 
Tags
getConstants()
Returns an array of constant names and their values.
    public
                    getConstants() : array<string|int, mixed>
    Tags
Return values
array<string|int, mixed> —An associative array where keys are constant names and values are their values.
getCreatableAttributes()
Returns the attributes needed to create.
    public
                    getCreatableAttributes() : array<string|int, mixed>
    Return values
array<string|int, mixed>getDiscord()
Get the Discord instance that owns this Part.
    public
                    getDiscord() : Discord
    Return values
DiscordgetPublicAttributes()
Returns an array of public attributes.
    public
                    getPublicAttributes() : array<string|int, mixed>
    Tags
Return values
array<string|int, mixed> —An array of public attributes.
getRawAttributes()
Returns an array of raw attributes.
    public
                    getRawAttributes() : array<string|int, mixed>
    Return values
array<string|int, mixed> —Raw attributes.
getRepositoryAttributes()
    public
                    getRepositoryAttributes() : array<string|int, mixed>
    Tags
Return values
array<string|int, mixed>getUpdatableAttributes()
    public
                    getUpdatableAttributes() : array<string|int, mixed>
    Tags
Return values
array<string|int, mixed>isPartial()
    public
                    isPartial() : bool
    Tags
Return values
booljsonSerialize()
Provides data when the part is encoded into JSON. Used for JsonSerializable.
    public
                    jsonSerialize() : array<string|int, mixed>
    Tags
Return values
array<string|int, mixed> —An array of public attributes.
offsetExists()
Checks if an attribute exists via key. Used for ArrayAccess.
    public
                    offsetExists(string $key) : bool
    Parameters
- $key : string
- 
                    The attribute key. 
Return values
bool —Whether the offset exists.
offsetGet()
Gets an attribute via key. Used for ArrayAccess.
    public
                    offsetGet(string $key) : mixed
    Parameters
- $key : string
- 
                    The attribute key. 
Tags
Attributes
- #[ReturnTypeWillChange]
offsetSet()
Sets an attribute via key. Used for ArrayAccess.
    public
                    offsetSet(string $key, mixed $value) : void
    Parameters
- $key : string
- 
                    The attribute key. 
- $value : mixed
- 
                    The attribute value. 
Tags
offsetUnset()
Unsets an attribute via key. Used for ArrayAccess.
    public
                    offsetUnset(string $key) : void
    Parameters
- $key : string
- 
                    The attribute key. 
save()
    public
                    save([string|null $reason = null ]) : PromiseInterface
    Parameters
- $reason : string|null = null
Tags
Return values
PromiseInterfaceserialize()
Serializes the data. Used for Serializable.
    public
                    serialize() : string|null
    Return values
string|null —A string of serialized data.
unserialize()
Unserializes some data and stores it. Used for Serializable.
    public
                    unserialize(string $data) : void
    Parameters
- $data : string
- 
                    Some serialized data. 
Tags
afterConstruct()
Called after the part has been constructed.
    protected
                    afterConstruct() : void
    attributeCarbonHelper()
Helps with getting ISO8601 timestamp attributes.
    protected
                    attributeCarbonHelper(string $key) : Carbon|null
    Parameters
- $key : string
- 
                    The attribute key. 
Tags
Return values
Carbon|nullattributeCollectionHelper()
Helps with getting Part attributes.
    protected
                    attributeCollectionHelper(string $key, string $class[, string|null $discrim = 'id' ]) : ExCollectionInterface
    Parameters
- $key : string
- 
                    The attribute key. 
- $class : string
- 
                    The attribute class. 
- $discrim : string|null = 'id'
- 
                    The attribute discriminator. 
Tags
Return values
ExCollectionInterfaceattributePartHelper()
Helps with getting Part attributes.
    protected
                    attributePartHelper(string $key, string $class[, array<string|int, mixed> $extraData = [] ]) : Part|null
    Parameters
- $key : string
- 
                    The attribute key. 
- $class : string
- 
                    The attribute class. 
- $extraData : array<string|int, mixed> = []
- 
                    Extra data to pass to the part constructor. 
Tags
Return values
Part|nullattributeTypedCollectionHelper()
Helps with getting Part attributes for classes with extended types.
    protected
                    attributeTypedCollectionHelper(string $class, string $key) : ExCollectionInterface
    Parameters
- $class : string
- 
                    The attribute class. 
- $key : string
- 
                    The attribute key. 
Return values
ExCollectionInterfacecheckForGetMutator()
Checks if there is a get mutator present.
    protected
                    checkForGetMutator(string $key) : string|false
    Parameters
- $key : string
- 
                    The attribute name to check. 
Tags
Return values
string|false —Either a string if it is a method or false.
checkForSetMutator()
Checks if there is a set mutator present.
    protected
                    checkForSetMutator(string $key) : string|false
    Parameters
- $key : string
- 
                    The attribute name to check. 
Tags
Return values
string|false —Either a string if it is a method or false.
getAttribute()
Gets an attribute on the part.
    protected
                    getAttribute(string $key) : mixed
    Parameters
- $key : string
- 
                    The key to the attribute. 
Tags
Return values
mixed —Either the attribute if it exists or void.
getGuildAttribute()
Returns the guild attribute.
    protected
                    getGuildAttribute() : Guild|null
    Return values
Guild|null —The guild the sticker belongs to.
getTagsAttribute()
Returns the tags attribute.
    protected
                    getTagsAttribute() : array<string|int, mixed>
    Return values
array<string|int, mixed>getUserAttribute()
Gets the user that created the sticker.
    protected
                    getUserAttribute() : User|null
    Return values
User|nullgetUserIdAttribute()
Returns the user_id attribute.
    protected
                    getUserIdAttribute() : string|null
    Return values
string|null —The identifier of the user that uploaded the guild sticker.
makeOptionalAttributes()
Return key-value attributes if it has been filled.
    protected
                    makeOptionalAttributes(array<string|int, mixed> $attributes) : array<string|int, mixed>
    To be used with fields marked "optional?" from the API.
Parameters
- $attributes : array<string|int, mixed>
- 
                    Names of optional attribute 
Return values
array<string|int, mixed>setAttribute()
Sets an attribute on the part.
    protected
                    setAttribute(string $key, mixed $value) : void
    Parameters
- $key : string
- 
                    The key to the attribute. 
- $value : mixed
- 
                    The value of the attribute. 
studly()
Converts a string to studlyCase.
    private
            static        studly(string $string) : string
    This is a port of updated Laravel's implementation, a non-regex with static cache. The Discord\studly() is kept due to unintended bug and we do not want to introduce BC by replacing it. This method is private static as we may move it outside this class in future.
Parameters
- $string : string
- 
                    The string to convert.