diff --git a/pages/api/v2/bots/[id].ts b/pages/api/v2/bots/[id].ts new file mode 100644 index 0000000..0b67063 --- /dev/null +++ b/pages/api/v2/bots/[id].ts @@ -0,0 +1,19 @@ +import { get } from '@utils/Query' +import ResponseWrapper from '@utils/ResponseWrapper' +import { NextApiRequest, NextApiResponse } from 'next' +import nc from 'next-connect' + +const BotInfo = nc() + .get(async(req, res) => { + const bot = await get.bot.load(req.query.id) + if(!bot) return ResponseWrapper(res, { code: 404, message: '존재하지 않는 봇입니다.' }) + else return ResponseWrapper(res, { code: 200, data: bot }) + }) + +interface ApiRequest extends NextApiRequest { + query: { + id: string + } +} + +export default BotInfo \ No newline at end of file