mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 09:59:09 +00:00
sync
This commit is contained in:
parent
13cd3bd4a0
commit
52cb96baa3
43 changed files with 3257 additions and 1072 deletions
|
@ -6,9 +6,21 @@ module.exports = (R, $) => {
|
|||
return
|
||||
})
|
||||
|
||||
R.get('/api/~/roles/:server', (ctx, next) => {
|
||||
R.get('/api/~/roles/:id/:userId', (ctx, next) => {
|
||||
// ctx.body = 'ok'
|
||||
ctx.body = $.discord.getRoles(ctx.params.server)
|
||||
return
|
||||
const { id, userId } = ctx.params
|
||||
|
||||
const srv = $.discord.client.guilds.get(id)
|
||||
|
||||
if (srv === undefined) {
|
||||
ctx.body = { err: 'not found' }
|
||||
ctx.status = 404
|
||||
return
|
||||
}
|
||||
|
||||
const gm = srv.members.get(userId)
|
||||
const roles = $.discord.presentableRoles(id, gm)
|
||||
|
||||
ctx.boy = roles
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue