mirror of
https://github.com/System-End/site.git
synced 2026-04-19 16:28:21 +00:00
support specifying first channel in requests to slack joining api
This commit is contained in:
parent
5481e1536c
commit
d68912050e
1 changed files with 3 additions and 2 deletions
|
|
@ -58,14 +58,15 @@ export default async function handler(req, res) {
|
|||
// I only got a successful response by putting all the args in URL params
|
||||
// Giving JSON body DID NOT WORK when testing locally
|
||||
// —@MaxWofford
|
||||
|
||||
|
||||
const LOBBY_ID = "C74HZS5A5";
|
||||
if(open){
|
||||
const params = [
|
||||
`email=${data.email}`,
|
||||
`token=${process.env.SLACK_LEGACY_TOKEN}`,
|
||||
`real_name=${data.name}`,
|
||||
'restricted=true',
|
||||
`channels=C74HZS5A5`,
|
||||
`channels=${data.firstChannel ?? LOBBY_ID}`,
|
||||
'resend=true'
|
||||
].join('&')
|
||||
const url = `https://slack.com/api/users.admin.invite?${params}`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue