2018-11-04 03:18:32 +09:00
|
|
|
import $ from 'cafy';
|
|
|
|
import Emoji from '../../../../../models/emoji';
|
|
|
|
import define from '../../../define';
|
|
|
|
|
|
|
|
export const meta = {
|
|
|
|
desc: {
|
|
|
|
'ja-JP': 'カスタム絵文字を取得します。'
|
|
|
|
},
|
|
|
|
|
|
|
|
requireCredential: true,
|
2018-11-15 04:15:42 +09:00
|
|
|
requireModerator: true,
|
2018-11-04 03:18:32 +09:00
|
|
|
|
|
|
|
params: {
|
|
|
|
host: {
|
2019-02-13 16:33:07 +09:00
|
|
|
validator: $.optional.nullable.str,
|
2018-11-04 03:18:32 +09:00
|
|
|
default: null as any
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-02-22 11:46:58 +09:00
|
|
|
export default define(meta, async (ps) => {
|
2018-11-04 03:18:32 +09:00
|
|
|
const emojis = await Emoji.find({
|
|
|
|
host: ps.host
|
|
|
|
});
|
|
|
|
|
2019-02-22 11:46:58 +09:00
|
|
|
return emojis.map(e => ({
|
2018-11-04 03:18:32 +09:00
|
|
|
id: e._id,
|
|
|
|
name: e.name,
|
|
|
|
aliases: e.aliases,
|
|
|
|
host: e.host,
|
|
|
|
url: e.url
|
2019-02-22 11:46:58 +09:00
|
|
|
}));
|
|
|
|
});
|