mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Fix annotations sending
This commit is contained in:
@@ -186,7 +186,7 @@ export async function createApprovedBot(token: string, state: BotState): Promise
|
|||||||
if (imageData) await ctx.telegram.sendPhoto(ctx.message.chat.id, {source: imageData});
|
if (imageData) await ctx.telegram.sendPhoto(ctx.message.chat.id, {source: imageData});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!annotation.text) return;
|
if (annotation.text.length === 0) return;
|
||||||
|
|
||||||
const data = getTextPaginationData(`${CallbackData.BOOK_ANNOTATION_PREFIX}${bookId}`, annotation.text, 0);
|
const data = getTextPaginationData(`${CallbackData.BOOK_ANNOTATION_PREFIX}${bookId}`, annotation.text, 0);
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ export async function createApprovedBot(token: string, state: BotState): Promise
|
|||||||
if (imageData) await ctx.telegram.sendPhoto(ctx.message.chat.id, {source: imageData});
|
if (imageData) await ctx.telegram.sendPhoto(ctx.message.chat.id, {source: imageData});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!annotation.text) return;
|
if (annotation.text.length === 0) return;
|
||||||
|
|
||||||
const data = getTextPaginationData(`${CallbackData.AUTHOR_ANNOTATION_PREFIX}${authorId}`, annotation.text, 0);
|
const data = getTextPaginationData(`${CallbackData.AUTHOR_ANNOTATION_PREFIX}${authorId}`, annotation.text, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export function getPaginationKeyboard(prefix: string, query: string | number, pa
|
|||||||
|
|
||||||
|
|
||||||
export function getTextPaginationData(prefix: string, text: string, currentPage: number): {current: string, keyboard: Markup.Markup<InlineKeyboardMarkup>} {
|
export function getTextPaginationData(prefix: string, text: string, currentPage: number): {current: string, keyboard: Markup.Markup<InlineKeyboardMarkup>} {
|
||||||
const chunks = chunkText(text, 512);
|
const chunks = chunkText(text, 512).filter((chunk) => chunk.length !== 0);
|
||||||
|
|
||||||
const current = chunks[currentPage];
|
const current = chunks[currentPage];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user