Skip to content

Commit

Permalink
fix(fmt): fmtCaption must not override parse_mode
Browse files Browse the repository at this point in the history
Unless necessary - when FmtString entities are present
  • Loading branch information
MKRhere committed Sep 23, 2022
1 parent 57a1814 commit e033a03
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ export function fmtCaption<
>(extra?: Extra): MaybeExtra<Extra> {
const caption = extra?.caption
if (!caption || typeof caption === 'string') return extra as MaybeExtra<Extra>
return {
...extra,
caption: caption.text,
caption_entities: caption.entities,
parse_mode: undefined,
}
const { text, ...fmt } = caption
return { ...extra, caption: text, ...fmt }
}

export function deprecate(
Expand Down

0 comments on commit e033a03

Please sign in to comment.