Skip to content

Commit

Permalink
fix(discord): support markdown syntax links
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Dec 26, 2023
1 parent 22d60b3 commit 69cf597
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adapters/discord/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,13 @@ export class DiscordMessageEncoder<C extends Context = Context> extends MessageE
await this.render(children)
this.buffer += '`'
} else if (type === 'a') {
this.buffer += '['
await this.render(children)
this.buffer += ']'
if (this.options.linkPreview) {
this.buffer += ` (${attrs.href}) `
this.buffer += `(${attrs.href})`
} else {
this.buffer += ` (<${attrs.href}>) `
this.buffer += `(<${attrs.href}>)`
}
} else if (type === 'br') {
this.buffer += '\n'
Expand Down

0 comments on commit 69cf597

Please sign in to comment.