mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-19 16:15:16 +00:00
Can get information about an emoji included in a POST request
This commit is contained in:
@ -42,6 +42,25 @@ export class CustomEmojisHelper {
|
||||
})).map((e) => this.DbToCustomEmoji(e));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get information about a single emoji
|
||||
*
|
||||
* @param emojiID The ID of the emoji to get
|
||||
* @throws An error if the emoji was not found
|
||||
*/
|
||||
public static async GetSingle(emojiID: number) : Promise<CustomEmoji> {
|
||||
const row = await DatabaseHelper.QueryRow({
|
||||
table: EMOJIS_TABLE,
|
||||
where: {
|
||||
id: emojiID
|
||||
}
|
||||
});
|
||||
|
||||
if(row == null)
|
||||
throw new Error("Requested emoji was not found ! (emoji id " + emojiID + ")")
|
||||
|
||||
return this.DbToCustomEmoji(row);
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a database entry into a custom emoji
|
||||
|
Reference in New Issue
Block a user