Skip to content

Commit

Permalink
add location ID to SDK (#281)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldchen authored Nov 13, 2024
1 parent 76857d3 commit 2cb879a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@discord/embedded-app-sdk",
"version": "1.6.1",
"version": "1.7.0",
"description": "@discord/embedded-app-sdk enables you to build rich, multiplayer experiences inside Discord.",
"author": "Discord",
"license": "MIT",
Expand Down
3 changes: 3 additions & 0 deletions src/Discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class DiscordSDK implements IDiscordSDK {
readonly platform: Platform;
readonly guildId: string | null;
readonly channelId: string | null;
readonly locationId: string | null;
readonly sdkVersion: string = sdkVersion;
readonly mobileAppVersion: string | null = null;
readonly configuration: SdkConfiguration;
Expand Down Expand Up @@ -121,6 +122,7 @@ export class DiscordSDK implements IDiscordSDK {
this.platform = Platform.DESKTOP;
this.guildId = null;
this.channelId = null;
this.locationId = null;
return;
}

Expand Down Expand Up @@ -151,6 +153,7 @@ export class DiscordSDK implements IDiscordSDK {

this.guildId = urlParams.get('guild_id');
this.channelId = urlParams.get('channel_id');
this.locationId = urlParams.get('location_id');

this.mobileAppVersion = urlParams.get('mobile_app_version');
// END Capture URL Query Params
Expand Down
4 changes: 3 additions & 1 deletion src/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ export class DiscordSDKMock implements IDiscordSDK {
public commands: IDiscordSDK['commands'];
readonly guildId: string | null;
readonly channelId: string | null;
readonly locationId: string | null;

constructor(clientId: string, guildId: string | null, channelId: string | null) {
constructor(clientId: string, guildId: string | null, channelId: string | null, locationId: string | null) {
this.clientId = clientId;

this.commands = this._updateCommandMocks({});
this.guildId = guildId;
this.channelId = channelId;
this.locationId = locationId;
}

_updateCommandMocks(newCommands: Partial<IDiscordSDK['commands']>) {
Expand Down

0 comments on commit 2cb879a

Please sign in to comment.