Skip to content

Commit

Permalink
docs(Activity): add documentation for buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu committed Apr 10, 2021
1 parent ab8b289 commit 6e9c820
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions deno/payloads/v8/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ export interface GatewayActivity {
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags?: ActivityFlags;
/**
* The custom buttons shown in the Rich Presence (max 2)
*/
buttons?: string[] | GatewayActivityButton[];
}

Expand Down Expand Up @@ -298,6 +301,12 @@ export enum ActivityFlags {
}

export interface GatewayActivityButton {
/**
* The text shown on the button (1-32 characters)
*/
label: string;
/**
* The url opened when clicking the button (1-512 characters)
*/
url: string;
}
3 changes: 1 addition & 2 deletions deno/rest/v8/oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export interface RESTPostOAuth2AccessTokenURLEncodedData {
grant_type: 'authorization_code';
code: string;
redirect_uri?: string;
scope: string;
}

/**
Expand All @@ -80,7 +79,7 @@ export interface RESTPostOAuth2RefreshTokenURLEncodedData {
grant_type: 'refresh_token';
refresh_token: string;
redirect_uri?: string;
scope: string;
scope?: string;
}

export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult;
Expand Down
9 changes: 9 additions & 0 deletions payloads/v8/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ export interface GatewayActivity {
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags?: ActivityFlags;
/**
* The custom buttons shown in the Rich Presence (max 2)
*/
buttons?: string[] | GatewayActivityButton[];
}

Expand Down Expand Up @@ -298,6 +301,12 @@ export const enum ActivityFlags {
}

export interface GatewayActivityButton {
/**
* The text shown on the button (1-32 characters)
*/
label: string;
/**
* The url opened when clicking the button (1-512 characters)
*/
url: string;
}

0 comments on commit 6e9c820

Please sign in to comment.