Function joinTextWithEntities

  • Join multiple text parts with entities into a single text with entities, adjusting the entities' offsets accordingly.

    Parameters

    Returns TextWithEntities

    A single text with entities

    const scoreboardText = joinTextWithEntities(
    apiResult.scoreboard.map((entry) => html`<b>${entry.name}</b>: ${entry.score}`),
    html`<br>`
    )
    await tg.sendText(chatId, html`<b>scoreboard:</b><br><br>${scoreboardText}`)