Skip to content

Commit

Permalink
fix(telegram): fix parsing logic (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anillc authored Jan 10, 2023
1 parent 45f2348 commit dfb951d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions adapters/telegram/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ export class TelegramBot<T extends TelegramBot.Config = TelegramBot.Config> exte
} else if (e.type === 'text_mention') {
segs.push(segment('at', { id: e.user.id }))
} else {
continue
// TODO: bold, italic, underline, strikethrough, spoiler, code, pre,
// text_link, custom_emoji
segs.push(segment('text', { content: eText }))
}
if (e.offset > curr) {
segs.splice(-1, 0, segment('text', { content: text.slice(curr, e.offset) }))
curr = e.offset + e.length
}
curr = e.offset + e.length
}
if (curr < text?.length || 0) {
segs.push(segment('text', { content: text.slice(curr) }))
Expand Down

0 comments on commit dfb951d

Please sign in to comment.