1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-19 16:15:16 +00:00

Create first custom emoji

This commit is contained in:
2020-04-03 16:20:08 +02:00
parent 2465b0c1ac
commit 131735a5f0
6 changed files with 108 additions and 1 deletions

View File

@ -0,0 +1,31 @@
/**
* Custom emojies helper
*
* @author Pierre Hubert
*/
import { CustomEmoji } from "../entities/CustomEmoji";
import { DatabaseHelper } from "./DatabaseHelper";
const EMOJIS_TABLE = "comunic_custom_emojis";
export class CustomEmojisHelper {
/**
* Insert a new custom emoji into the database
*
* @param e The emoji to insert
* @return The ID of the created emoji
*/
public static async Insert(e: CustomEmoji) : Promise<number> {
return await DatabaseHelper.InsertRow(
EMOJIS_TABLE,
{
user_id: e.userID,
shorcut: e.shorcut,
path: e.path
}
)
}
}