Skip to content

Commit

Permalink
feat(discord): support channel type voice and category, fix #214
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Dec 30, 2023
1 parent 69cf597 commit 601eaba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion adapters/discord/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ export const decodeGuild = (data: Discord.Guild): Universal.Guild => ({
export const decodeChannel = (data: Discord.Channel): Universal.Channel => ({
id: data.id,
name: data.name,
type: data.type === Discord.Channel.Type.DM ? Universal.Channel.Type.DIRECT : Universal.Channel.Type.TEXT,
type: data.type === Discord.Channel.Type.DM ? Universal.Channel.Type.DIRECT
: data.type === Discord.Channel.Type.GUILD_VOICE ? Universal.Channel.Type.VOICE
: data.type === Discord.Channel.Type.GUILD_CATEGORY ? Universal.Channel.Type.CATEGORY
: Universal.Channel.Type.TEXT,
})

export const decodeRole = (role: Discord.Role): Universal.GuildRole => ({
Expand Down

0 comments on commit 601eaba

Please sign in to comment.