Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Integration): add scopes #8483

Merged
merged 1 commit into from
Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/discord.js/src/structures/Integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
almeidx marked this conversation as resolved.
Show resolved Hide resolved
} else {
this.scopes ??= [];
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,7 @@ export class Integration extends Base {
public role: Role | null;
public enableEmoticons: boolean | null;
public get roles(): Collection<Snowflake, Role>;
public scopes: OAuth2Scopes[];
public get syncedAt(): Date | null;
public syncedTimestamp: number | null;
public syncing: boolean | null;
Expand Down