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:
31
src/helpers/CustomEmojisHelper.ts
Normal file
31
src/helpers/CustomEmojisHelper.ts
Normal 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
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user