Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GuildAssetsMethods

Methods for interacting with emojis

Hierarchy

  • GuildAssetsMethods

Index

Constructors

  • Create a new GuildAssets Method handler

    Usually SnowTransfer creates a method handler for you, this is here for completion

    You can access the methods listed via client.guildAssets.method, where client is an initialized SnowTransfer instance

    Parameters

    Returns <internal>.GuildAssetsMethods

Properties

requestHandler: <internal>.RequestHandler

Methods

  • Create a new Emoji

    example

    // upload a simple png emoji with a name of "niceEmoji" const client = new SnowTransfer('TOKEN'); const fileData = fs.readFileSync('nice_emoji.png') // You should probably use fs.readFile, since it's asynchronous, synchronous methods pause the thread. const emojiData = { name: 'niceEmoji', image: data:image/png;base64,${fileData.toString('base64')} // base64 data url: data:mimetype;base64,base64String } client.guildAssets.createEmoji('guild id', emojiData)

    Parameters

    Returns Promise<<internal>.Emoji>

    (https://discord.com/developers/docs/resources/emoji#emoji-object)

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS always
  • Create a guild sticker

    Parameters

    Returns Promise<<internal>.Sticker>

    A sticker object

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS always
    Guild VERIFIED or PARTNERED If CurrentUser tries to create a LOTTIE sticker
  • deleteEmoji(guildId: string, emojiId: string, reason?: string): Promise<void>
  • Delete an emoji

    Parameters

    • guildId: string

      Id of the guild

    • emojiId: string

      Id of the emoji

    • Optional reason: string

      Reason for deleting the emoji

    Returns Promise<void>

    Resolves the Promise on successful execution

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS always
  • deleteGuildSticker(guildId: string, stickerId: string, reason?: string): Promise<void>
  • Delete a guild sticker

    Parameters

    • guildId: string

      Id of the guild

    • stickerId: string

      Id of the sticker

    • Optional reason: string

    Returns Promise<void>

    Resolves the Promise on successful execution

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS always
  • Get a list of emojis of a guild

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<<internal>.Emoji[]>

    Array of emoji objects

  • Get a guild sticker

    Parameters

    • guildId: string

      Id of the guild

    • stickerId: string

      Id of the sticker

    Returns Promise<<internal>.Sticker>

    A sticker object

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS if the CurrentUser desires the user field
  • Get all guild stickers

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<<internal>.Sticker[]>

    An Array of sticker objects

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS if the CurrentUser desires the user field
  • updateEmoji(guildId: string, emojiId: string, data: { name?: string; reason?: string; roles?: null | string[] }): Promise<<internal>.Emoji>
  • Update an existing emoji

    example

    // Change the name of an existing emoji to "niceEmote" const client = new SnowTransfer('TOKEN'); const emojiData = { name: 'niceEmote' } client.guildAssets.updateEmoji('guild id', 'emoji id', emojiData)

    Parameters

    • guildId: string

      Id of the guild

    • emojiId: string

      Id of the emoji

    • data: { name?: string; reason?: string; roles?: null | string[] }

      Emoji data

      • Optional name?: string
      • Optional reason?: string
      • Optional roles?: null | string[]

    Returns Promise<<internal>.Emoji>

    (https://discord.com/developers/docs/resources/emoji#emoji-object)

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS always
  • updateGuildSticker(guildId: string, stickerId: string, data: { description?: null | string; name?: string; reason?: string; tags?: string }): Promise<<internal>.Sticker>
  • Update a guild sticker

    Parameters

    • guildId: string

      Id of the guild

    • stickerId: string

      Id of the sticker

    • data: { description?: null | string; name?: string; reason?: string; tags?: string }

      Sticker data

      • Optional description?: null | string
      • Optional name?: string
      • Optional reason?: string
      • Optional tags?: string

    Returns Promise<<internal>.Sticker>

    A sticker object

    Permissions needed Condition
    MANAGE_EMOJIS_AND_STICKERS always

Generated using TypeDoc