generated from HelloUnspecified/template-graph-server
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add DiscordInfo type to session base interface
- Loading branch information
Showing
19 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import constants from '../../../constants'; | ||
|
||
export function parseDiscordInfo(discordInfo) { | ||
let discordInfoResult = null; | ||
if (discordInfo) { | ||
const { guildId, channelId, guildScheduledEventId, inviteUrl } = | ||
discordInfo; | ||
discordInfoResult = { | ||
guildId: guildId ?? '', | ||
channelId: channelId ?? '', | ||
guildScheduledEventId: guildScheduledEventId ?? null, | ||
inviteUrl: inviteUrl ?? '', | ||
channelUrl: null, | ||
guildScheduledEventUrl: null, | ||
guildScheduledEventInviteUrl: null, | ||
}; | ||
if (guildId && channelId) { | ||
discordInfoResult.channelUrl = `${constants.discord.baseUrl}/channels/${guildId}/${channelId}`; | ||
} | ||
if (guildId && guildScheduledEventId) { | ||
discordInfoResult.guildScheduledEventUrl = `${constants.discord.baseUrl}/events/${guildId}/${guildScheduledEventId}`; | ||
} | ||
if (inviteUrl && guildScheduledEventId) { | ||
discordInfoResult.guildScheduledEventInviteUrl = `${inviteUrl}?event=${guildScheduledEventId}`; | ||
} | ||
} | ||
|
||
return discordInfoResult; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
type DiscordInfo { | ||
"Guild/server this information relates to" | ||
guildId: String | ||
"The voice channel setup for this session" | ||
channelId: String | ||
"The url pointing directly to the channel" | ||
channelUrl: URL | ||
"A discord channel invite for the referenced channel" | ||
inviteUrl: URL | ||
"The event setup for this session which references the channel" | ||
guildScheduledEventId: String | ||
"The url pointing directly to the guild scheduled event" | ||
guildScheduledEventUrl: URL | ||
"Event invite (same as channel with event id parameter)" | ||
guildScheduledEventInviteUrl: URL | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters