mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-24 19:59:12 +00:00
feat(API): add import-to-next api method
This commit is contained in:
parent
beeb1f7503
commit
00139128ea
1 changed files with 12 additions and 0 deletions
|
@ -159,6 +159,18 @@ module.exports = (R, $) => {
|
|||
$.P.invalidate(userId)
|
||||
$.discord.invalidate(userId)
|
||||
})
|
||||
|
||||
R.get('/x/import-to-next/:server', async (ctx) => {
|
||||
const { server } = ctx.params
|
||||
const { authorization } = ctx.headers
|
||||
|
||||
if (authorization !== `Shared ${process.env.BOT_IMPORT_TOKEN}`) {
|
||||
return
|
||||
}
|
||||
|
||||
const serverData = await $.server.get(server)
|
||||
ctx.body = serverData
|
||||
})
|
||||
}
|
||||
|
||||
// if length is the same, check elements.
|
||||
|
|
Loading…
Add table
Reference in a new issue