mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-22 18:48:06 +09:00
24 lines
431 B
TypeScript
24 lines
431 B
TypeScript
import db from '../db/mongodb';
|
|
|
|
const Emoji = db.get<IEmoji>('emoji');
|
|
Emoji.createIndex('name');
|
|
Emoji.createIndex('host');
|
|
Emoji.createIndex(['name', 'host'], { unique: true });
|
|
|
|
export default Emoji;
|
|
|
|
export type IEmoji = {
|
|
name: string;
|
|
host: string;
|
|
url: string;
|
|
aliases?: string[];
|
|
updatedAt?: Date;
|
|
};
|
|
|
|
export const packEmojis = async (
|
|
host: string,
|
|
// MeiTODO: filter
|
|
) => {
|
|
return await Emoji.find({ host });
|
|
};
|