Skip to content

Commit

Permalink
refactor: improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Syjalo committed Aug 29, 2024
1 parent 72f9251 commit 2b25024
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/discord.js/src/structures/ClientApplication.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ class ClientApplication extends Application {
*/
this.integrationTypesConfig = Object.fromEntries(
Object.entries(data.integration_types_config).map(([key, config]) => {
let oauth2InstallParams = null;
if ('oauth2_install_params' in config) {
oauth2InstallParams = {
scopes: config.oauth2_install_params.scopes,
permissions: new PermissionsBitField(config.oauth2_install_params.permissions).freeze(),
};
}

const context = {
oauth2InstallParams:
'oauth2_install_params' in config
? {
scopes: config.oauth2_install_params.scopes,
permissions: new PermissionsBitField(config.oauth2_install_params.permissions).freeze(),
}
: null,
oauth2InstallParams,
};

return [key, context];
Expand Down

0 comments on commit 2b25024

Please sign in to comment.