fix(client): use quoteOffset for quotes
This commit is contained in:
parent
799fce4152
commit
9ed587209c
2 changed files with 9 additions and 0 deletions
|
@ -56,6 +56,11 @@ export interface CommonSendParams {
|
|||
*/
|
||||
quote?: TextWithEntities
|
||||
|
||||
/**
|
||||
* Offset of the start of the quote in the message.
|
||||
*/
|
||||
quoteOffset?: number
|
||||
|
||||
/**
|
||||
* Whether to send this message silently.
|
||||
*/
|
||||
|
@ -140,6 +145,7 @@ export async function _processCommonSendParameters(
|
|||
replyToPeerId: replyToPeer,
|
||||
quoteText: params.quote?.text,
|
||||
quoteEntities: params.quote?.entities as tl.TypeMessageEntity[],
|
||||
quoteOffset: params.quoteOffset,
|
||||
}
|
||||
} else if (params.replyToStory) {
|
||||
tlReplyTo = {
|
||||
|
|
|
@ -67,6 +67,7 @@ export function quoteWithText(
|
|||
const params_ = params__ as NonNullable<Parameters<typeof sendText>[3]>
|
||||
params_.replyTo = message
|
||||
params_.quote = extractQuote(message, params.start, params.end)
|
||||
params_.quoteOffset = params.start
|
||||
|
||||
return sendText(client, toChatId, text, params_)
|
||||
}
|
||||
|
@ -84,6 +85,7 @@ export function quoteWithMedia(
|
|||
const params_ = params__ as NonNullable<Parameters<typeof sendMedia>[3]>
|
||||
params_.replyTo = message
|
||||
params_.quote = extractQuote(message, params.start, params.end)
|
||||
params_.quoteOffset = params.start
|
||||
|
||||
return sendMedia(client, toChatId, media, params_)
|
||||
}
|
||||
|
@ -101,6 +103,7 @@ export function quoteWithMediaGroup(
|
|||
const params_ = params__ as NonNullable<Parameters<typeof sendMediaGroup>[3]>
|
||||
params_.replyTo = message
|
||||
params_.quote = extractQuote(message, params.start, params.end)
|
||||
params_.quoteOffset = params.start
|
||||
|
||||
return sendMediaGroup(client, message.chat.inputPeer, medias, params_)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue