Skip to content

Commit

Permalink
feat: add custom_id and referrer_id query params
Browse files Browse the repository at this point in the history
  • Loading branch information
goatslacker authored Dec 16, 2024
1 parent abb6c72 commit 96777ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Discord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ interface HandshakePayload {
export class DiscordSDK implements IDiscordSDK {
readonly clientId: string;
readonly instanceId: string;
readonly customId: string | null;
readonly referrerId: string | null;
readonly platform: Platform;
readonly guildId: string | null;
readonly channelId: string | null;
Expand Down Expand Up @@ -119,6 +121,8 @@ export class DiscordSDK implements IDiscordSDK {
if (typeof window === 'undefined') {
this.frameId = '';
this.instanceId = '';
this.customId = null;
this.referrerId = null;
this.platform = Platform.DESKTOP;
this.guildId = null;
this.channelId = null;
Expand Down Expand Up @@ -151,6 +155,8 @@ export class DiscordSDK implements IDiscordSDK {
}
this.platform = platform;

this.customId = urlParams.get('custom_id');
this.referrerId = urlParams.get('referrer_id');
this.guildId = urlParams.get('guild_id');
this.channelId = urlParams.get('channel_id');
this.locationId = urlParams.get('location_id');
Expand Down

0 comments on commit 96777ac

Please sign in to comment.