summaryrefslogtreecommitdiff
path: root/src/models/emoji.ts
blob: 8e75868e62902b33bd70801c0e213469ea02804d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import * as mongo from 'mongodb';
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 = {
	_id: mongo.ObjectID;
	name: string;
	host: string;
	url: string;
	aliases?: string[];
	updatedAt?: Date;
};