11/*
22 Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
33 Copyright (C) 2023 Spacebar and Spacebar Contributors
4-
4+
55 This program is free software: you can redistribute it and/or modify
66 it under the terms of the GNU Affero General Public License as published
77 by the Free Software Foundation, either version 3 of the License, or
88 (at your option) any later version.
9-
9+
1010 This program is distributed in the hope that it will be useful,
1111 but WITHOUT ANY WARRANTY; without even the implied warranty of
1212 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1313 GNU Affero General Public License for more details.
14-
14+
1515 You should have received a copy of the GNU Affero General Public License
1616 along with this program. If not, see <https://www.gnu.org/licenses/>.
1717*/
@@ -214,7 +214,7 @@ router.post(
214214 if ( ! app ) throw new ApiError ( "Unknown Application" , 10002 , 404 ) ;
215215 if ( ! app . bot ) throw new ApiError ( "OAuth2 application does not have a bot" , 50010 , 400 ) ;
216216
217- await Member . addToGuild ( app . id , body . guild_id ) ;
217+ await Member . addToGuild ( app . bot . id , body . guild_id ) ;
218218 if ( body . permissions ) {
219219 const role = Role . create ( {
220220 managed : true ,
@@ -228,7 +228,7 @@ router.post(
228228 position : 1 , // TODO: calculate actual position and move stuff around
229229 } ) ;
230230 await role . save ( ) ;
231- await Member . addRole ( body . guild_id , req . user_id , role . id ) ;
231+ await Member . addRole ( app . bot . id , body . guild_id , role . id ) ;
232232 }
233233
234234 return res . json ( {
0 commit comments