import define from "../../../define.js";
import { UserEmojis } from "../../../../../models/index.js";
export const meta = {
    tags: [
        "account"
    ],
    requireCredential: true,
    kind: "read:account"
};
export const paramDef = {
    type: "object",
    properties: {},
    required: []
};
export default define(meta, paramDef, async (_ps, me)=>{
    const emojis = await UserEmojis.find({
        where: {
            userId: me.id
        },
        order: {
            createdAt: "DESC"
        }
    });
    return emojis.map((emoji)=>({
            id: emoji.id,
            name: emoji.name,
            url: emoji.publicUrl || emoji.originalUrl,
            glyph: emoji.glyph,
            glyphUrl: emoji.glyph ? emoji.originalUrl : null,
            width: emoji.width,
            height: emoji.height
        }));
});
