Add endpoint

This commit is contained in:
ThatOneCalculator 2022-07-27 09:58:18 -07:00
parent 4a7166625f
commit 7ae95770aa
1 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,32 @@
// import { IsNull } from 'typeorm';
import { fetchMeta } from '@/misc/fetch-meta.js';
import define from '../define.js';
export const meta = {
tags: ['meta'],
requireCredential: false,
requireCredentialPrivateMode: true,
res: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,
},
},
} as const;
export const paramDef = {
type: 'array',
properties: {},
required: [],
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async () => {
const meta = await fetchMeta();
const motd = await Promise.all(meta.customMOTD.map(x => x));
return motd;
});