Skip to content
Snippets Groups Projects
Unverified Commit 819b535a authored by syuilo's avatar syuilo
Browse files

[API] Implement admin/add-emoji

parent 60e95ac2
No related branches found
No related tags found
No related merge requests found
import $ from 'cafy';
import Emoji from '../../../../models/emoji';
import define from '../../define';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を追加します。'
},
requireCredential: true,
requireAdmin: true,
params: {
name: {
validator: $.str
},
url: {
validator: $.str
},
aliases: {
validator: $.arr($.str).optional,
default: [] as string[]
}
}
};
export default define(meta, (ps) => new Promise(async (res, rej) => {
await Emoji.insert({
name: ps.name,
host: null,
aliases: ps.aliases,
url: ps.url
});
res();
}));
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment