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 is 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

    example

    // Creates a LOTTIE sticker const client = new SnowTransfer("TOKEN") const fileData = fs.readFileSync("nice_sticker.json") // You should probably use fs.readFile, since it is asynchronous, synchronous methods pause the thread. const stickerData = { name: "niceSticker", file: fileData, description: "A very nice sticker", tags: ["nice", "sticker"], reason: "because it was nice" } const sticker = await client.guildAssets.createGuildSticker("guild id", stickerData)

    Parameters

    Returns Promise<<internal>.Sticker>

    A sticker object

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

    example

    // Deletes an emoji because it wasn't nice const client = new SnowTransfer("TOKEN") client.guildAssets.deleteEmoji("guild id", "emoji id", "wasn't nice")

    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

    example

    // Deletes a sticker because it was too nice const client = new SnowTransfer("TOKEN") client.guildAssets.deleteGuildSticker("guild id", "sticker id", "It was too nice")

    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

    example

    const client = new SnowTransfer("TOKEN") const emojis = await client.guildAssets.getEmojis("guild id")

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<<internal>.Emoji[]>

    Array of emoji objects

  • Get a guild sticker

    example

    const client = new SnowTransfer("TOKEN") const sticker = await client.guildAssets.getGuildSticker("guild id", "sticker id")

    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

    example

    const client = new SnowTransfer("TOKEN") const stickers = await client.guildAssets.getGuildStickers("guild id")

    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

    example

    // Updates a sticker's name to "nicerSticker" const client = new SnowTransfer("TOKEN") const sticker = await client.guildAssets.updateGuildSticker("guild id", "sticker id", { name: "nicerSticker", reason: "because it was nicer" })

    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