diff --git a/src/classes/Emoji.ts b/src/classes/Emoji.ts index e5bf66a5..0c663625 100644 --- a/src/classes/Emoji.ts +++ b/src/classes/Emoji.ts @@ -1,7 +1,8 @@ -import type { EmojiParent } from "stoat-api"; +import type { DataEditEmoji, EmojiParent } from "stoat-api"; import { decodeTime } from "ulid"; import type { EmojiCollection } from "../collections/EmojiCollection.js"; +import { hydrate } from "../hydration/index.js"; import type { User } from "./User.js"; @@ -90,6 +91,21 @@ export class Emoji { }`; } + async edit(data: DataEditEmoji): Promise { + this.#collection.updateUnderlyingObject( + this.id, + hydrate( + "emoji", + await this.#collection.client.api.patch( + `/custom/emoji/${this.id as ""}`, + data, + ), + this.#collection.client, + false, + ), + ); + } + /** * Delete Emoji */