From 8b3d0061180cfd5d9ba8beae3e8d623b5ce43ea4 Mon Sep 17 00:00:00 2001 From: Almeida Date: Sun, 4 Sep 2022 09:11:27 +0100 Subject: [PATCH] feat(Integration): add `scopes` (#8483) --- packages/discord.js/src/structures/Integration.js | 10 ++++++++++ packages/discord.js/typings/index.d.ts | 1 + 2 files changed, 11 insertions(+) diff --git a/packages/discord.js/src/structures/Integration.js b/packages/discord.js/src/structures/Integration.js index 1afc8f14a..d51dfbda8 100644 --- a/packages/discord.js/src/structures/Integration.js +++ b/packages/discord.js/src/structures/Integration.js @@ -185,6 +185,16 @@ class Integration extends Base { } else { this.application ??= null; } + + if ('scopes' in data) { + /** + * The scopes this application has been authorized for + * @type {OAuth2Scopes[]} + */ + this.scopes = data.scopes; + } else { + this.scopes ??= []; + } } /** diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index 91a071d56..c450df38f 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1450,6 +1450,7 @@ export class Integration extends Base { public role: Role | null; public enableEmoticons: boolean | null; public get roles(): Collection; + public scopes: OAuth2Scopes[]; public get syncedAt(): Date | null; public syncedTimestamp: number | null; public syncing: boolean | null;