summary refs log tree commit diff
path: root/src/api/routes/applications/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/applications/index.ts')
-rw-r--r--src/api/routes/applications/index.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/api/routes/applications/index.ts b/src/api/routes/applications/index.ts

index 1e536a06..5bba3338 100644 --- a/src/api/routes/applications/index.ts +++ b/src/api/routes/applications/index.ts
@@ -20,7 +20,9 @@ import { route } from "@spacebar/api"; import { Application, ApplicationCreateSchema, + Config, User, + createAppBotUser, trimSpecial, } from "@spacebar/util"; import { Request, Response, Router } from "express"; @@ -68,7 +70,11 @@ router.post( flags: 0, }); - await app.save(); + // april 14, 2023: discord made bot users be automatically added to all new apps + const { autoCreateBotUsers } = Config.get().general; + if (autoCreateBotUsers) { + await createAppBotUser(app, req); + } else await app.save(); res.json(app); },