Skip to content

Commit 2cb879a

Browse files
author
Donald Chen
authored
add location ID to SDK (#281)
1 parent 76857d3 commit 2cb879a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@discord/embedded-app-sdk",
3-
"version": "1.6.1",
3+
"version": "1.7.0",
44
"description": "@discord/embedded-app-sdk enables you to build rich, multiplayer experiences inside Discord.",
55
"author": "Discord",
66
"license": "MIT",

src/Discord.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export class DiscordSDK implements IDiscordSDK {
6666
readonly platform: Platform;
6767
readonly guildId: string | null;
6868
readonly channelId: string | null;
69+
readonly locationId: string | null;
6970
readonly sdkVersion: string = sdkVersion;
7071
readonly mobileAppVersion: string | null = null;
7172
readonly configuration: SdkConfiguration;
@@ -121,6 +122,7 @@ export class DiscordSDK implements IDiscordSDK {
121122
this.platform = Platform.DESKTOP;
122123
this.guildId = null;
123124
this.channelId = null;
125+
this.locationId = null;
124126
return;
125127
}
126128

@@ -151,6 +153,7 @@ export class DiscordSDK implements IDiscordSDK {
151153

152154
this.guildId = urlParams.get('guild_id');
153155
this.channelId = urlParams.get('channel_id');
156+
this.locationId = urlParams.get('location_id');
154157

155158
this.mobileAppVersion = urlParams.get('mobile_app_version');
156159
// END Capture URL Query Params

src/mock.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ export class DiscordSDKMock implements IDiscordSDK {
2424
public commands: IDiscordSDK['commands'];
2525
readonly guildId: string | null;
2626
readonly channelId: string | null;
27+
readonly locationId: string | null;
2728

28-
constructor(clientId: string, guildId: string | null, channelId: string | null) {
29+
constructor(clientId: string, guildId: string | null, channelId: string | null, locationId: string | null) {
2930
this.clientId = clientId;
3031

3132
this.commands = this._updateCommandMocks({});
3233
this.guildId = guildId;
3334
this.channelId = channelId;
35+
this.locationId = locationId;
3436
}
3537

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

0 commit comments

Comments
 (0)