summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorOh64 <contact@oh64.moe>2026-07-29 01:33:40 +0200
committerRory& <root@rory.gay>2026-07-29 01:57:58 +0200
commitfda2bdd2e14d31b9786b3676684657b110ee9dd7 (patch)
tree0beb2f61b1455ee253c824d7528a4ca0f2ec83c3 /src/api
parentnix: force slice for gateway when sharding (diff)
downloadserver-ts-fda2bdd2e14d31b9786b3676684657b110ee9dd7.tar.xz
fix bot add in guild
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/oauth2/authorize.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/api/routes/oauth2/authorize.ts b/src/api/routes/oauth2/authorize.ts

index 5e9a0cab..1b506c81 100644 --- a/src/api/routes/oauth2/authorize.ts +++ b/src/api/routes/oauth2/authorize.ts
@@ -1,17 +1,17 @@ /* Spacebar: A FOSS re-implementation and extension of the Discord.com backend. Copyright (C) 2023 Spacebar and Spacebar Contributors - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. */ @@ -214,7 +214,7 @@ router.post( if (!app) throw new ApiError("Unknown Application", 10002, 404); if (!app.bot) throw new ApiError("OAuth2 application does not have a bot", 50010, 400); - await Member.addToGuild(app.id, body.guild_id); + await Member.addToGuild(app.bot.id, body.guild_id); if (body.permissions) { const role = Role.create({ managed: true, @@ -228,7 +228,7 @@ router.post( position: 1, // TODO: calculate actual position and move stuff around }); await role.save(); - await Member.addRole(body.guild_id, req.user_id, role.id); + await Member.addRole(app.bot.id, body.guild_id, role.id); } return res.json({