
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
temeco
Advanced tools
temeco is a simple Telegram message entities to html translator.
Telegram Bot API makes it cumbersome fro bots to copy a user's message
preserving its entities, since it is currently impossible for a bot to send
entities directly along with a message,
so it needs to translate a message with entities into HTML or Markdown.
This little package solves this problem and provides a convenient way to translate a message with entities to HTML.
TelegramUTF16Text class is also aware of the fact that Telegram calculates
offsets for entities using UTF-16 encoding.
This comes into play when text being copied contains symbols which have different lengths
in UTF-8 and UTF-16 code units, like emojis.
pip install temeco
from temeco.temeco import BasicEntity, TelegramUTF16Text, HtmlFromMsg
text = (
"dolorem ipsum, quia dolor sit, 🔥🚒 amet, consectetur, adipisci velit, sed quia 🙃 non numquam eius modi"
" tempora incidunt, 🙊\nut labore et dolore magnam aliquam quaerat voluptatem."
)
HtmlFromMsg(
msg_txt=TelegramUTF16Text(text),
entities=[
BasicEntity(
type="bold", offset=8, length=5, msg_text=TelegramUTF16Text(text)
),
BasicEntity(
type="code", offset=55, length=8, msg_text=TelegramUTF16Text(text)
),
BasicEntity(
type="text_link",
offset=64,
length=5,
data={"url": "http://google.com/"},
msg_text=TelegramUTF16Text(text),
),
BasicEntity(
type="italic",
offset=153,
length=7,
msg_text=TelegramUTF16Text(text),
),
],
).as_str()
BasicEntity class supports the following types of entities:
bolditalictext_linkcode (monospace text)pre (preformatted text)Entities like hashtags and usernames are copied as is, since Telegram recognizes them without extra code.
You may create your own class implementing Entity interface and use it instead of
BasicEntity.
FAQs
A small package handling telegram message copying preserving text entities
We found that temeco demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.