Skip to content

Commit

Permalink
Fix token retrieval in Discord integration (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrrikkotua authored Jul 18, 2023
1 parent 0f132e0 commit 4391711
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const handler: GenerateStreamsHandler = async (ctx) => {

await ctx.publishStream<DiscordRootStreamData>(DiscordStreamType.ROOT, {
guildId,
token: ctx.integration.token,
channels: settingsChannels,
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export const cacheDiscordChannels = async (
}

export const getDiscordToken = (ctx: IProcessStreamContext): string => {
if (ctx.integration.token) {
return `Bot ${ctx.integration.token}`
}
const token = ctx.platformSettings as IDiscordPlatformSettings
return `Bot ${token.token}`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export interface IDiscordAPIData {

export interface DiscordRootStreamData {
guildId: string
token: string
// eslint-disable-next-line @typescript-eslint/no-explicit-any
channels: any[]
}
Expand Down

0 comments on commit 4391711

Please sign in to comment.