Skip to content

Comments

feat: gamesdk support#529

Closed
vvito7 wants to merge 7 commits intodiscordjs:mainfrom
vvito7:game-sdk
Closed

feat: gamesdk support#529
vvito7 wants to merge 7 commits intodiscordjs:mainfrom
vvito7:game-sdk

Conversation

@vvito7
Copy link

@vvito7 vvito7 commented Jul 15, 2022

Please describe the changes this PR makes and why it should be merged:
This PR adds support for all GameSDK stuff.
I ran into many problems while writing payloads and rest files, such as doubts about Update User Achievement (this one seems not to be working) and Get User Achievements (this one I just don't understand) endpoints. So be free to correct or explain me some mistake I made 😄
Closes #68 and replaces #88.

If applicable, please reference Discord API Docs PRs or commits that influenced this PR:

@vercel
Copy link

vercel bot commented Jul 15, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
discord-api-types ✅ Ready (Inspect) Visit Preview Oct 14, 2022 at 5:29PM (UTC)

/**
* https://discord.com/developers/docs/game-sdk/lobbies#update-lobby-member
*/
export type RESTPatchAPILobbyMemberJSONBody = Pick<APILobby, 'metadata'>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial<>? Also missing result type

/**
* https://discord.com/developers/docs/game-sdk/lobbies#send-lobby-data
*/
export interface RESTPostAPILobbyDataJSONBody {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result type?

/**
* https://discord.com/developers/docs/game-sdk/lobbies#create-lobby-search
*/
export interface RESTPostAPILobbySearchJSONBody {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result?

/**
* https://discord.com/developers/docs/game-sdk/store#get-entitlement
*/
export type RESTGetAPIEntitlementQuery = Pick<RESTGetAPIEntitlementsQuery, 'with_payments'>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You get JUST with_payments

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this type is for the query params that can only contain with_payments

Comment on lines 92 to 121
export enum LobbyRegion {
Atlanta = 'atlanta',
Brazil = 'brazil',
Bucharest = 'bucharest',
BuenosAires = 'buenos-aires',
Dubai = 'dubai',
Finland = 'finland',
Hongkong = 'hongkong',
India = 'india',
Japan = 'japan',
Madrid = 'madrid',
Milan = 'milan',
Montreal = 'montreal',
Newark = 'newark',
Rotterdam = 'rotterdam',
Russia = 'russia',
SantaClara = 'santa-clara',
Santiago = 'santiago',
Seattle = 'seattle',
Singapore = 'singapore',
SouthKorea = 'south-korea',
SouthAfrica = 'southafrica',
StPete = 'st-pete',
Stockholm = 'stockholm',
Sydney = 'sydney',
UsCentral = 'us-central',
UsEast = 'us-east',
UsSouth = 'us-south',
UsWest = 'us-west',
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wheres this from?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got these from this request (that btw doesn't use the same regions as /voice/regions)
image

Copy link
Contributor

@advaith1 advaith1 Jul 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably just all the possible voice regions, /voice/regions only returns the ones u can manually set voice channels to

this list can change at any time so idk, @vladfrangu do u think it should be included? this is a superset of the options for channel rtc_region (the lists arent documented anywhere)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets leave these as string because voice regions will come and go and truthfully, an enum of them is not useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GameSDK routes

3 participants