
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
aiotgbot
Advanced tools
aiotgbot is available on PyPI. Use pip to install it:
pip install aiotgbot
from typing import AsyncIterator
from aiotgbot import (
Bot,
BotUpdate,
BotUpdateKey,
HandlerTable,
PollBot,
PrivateChatFilter,
Runner,
)
from aiotgbot.storage_memory import MemoryStorage
handlers = HandlerTable()
@handlers.message(filters=[PrivateChatFilter()])
async def reply_private_message(bot: Bot, update: BotUpdate) -> None:
assert update.message is not None
name = (
f"{update.message.chat.first_name} "
f"{update.message.chat.last_name}"
)
update["greeting_count"] = update.get("greeting_count", 0) + 1
await bot.send_message(update.message.chat.id, f"Hello, {name}!")
async def run_context(runner: Runner) -> AsyncIterator[None]:
storage = MemoryStorage()
await storage.connect()
handlers.freeze()
bot = PollBot(runner["token"], handlers, storage)
await bot.start()
yield
await bot.stop()
await storage.close()
def main() -> None:
runner = Runner(run_context)
runner["token"] = "some:token"
runner.run()
if __name__ == "__main__":
main()
New features:
BotUpdate.BotUpdate exposes get_typed(key), set_typed(key, value), and del_typed(key) helpers for working with BotUpdateKey instances.BotUpdateKey enforces runtime type checking via isinstance() so handlers only see the expected payload.BotUpdate remains a regular mutable mapping so filters and handlers can stash arbitrary helper objects between each other. To keep data structured, use BotUpdateKey which enforces types per slot:
from dataclasses import dataclass
from aiotgbot import BotUpdateKey
@dataclass
class Session:
trace_id: str
retries: int
session_key = BotUpdateKey("session", Session)
async def my_handler(bot: Bot, update: BotUpdate) -> None:
if session_key.name not in update:
update.set_typed(session_key, Session(trace_id="abc", retries=0))
session = update.get_typed(session_key)
...
We use Prek as a drop-in pre-commit replacement backed by uv so hook environments resolve quickly and reproducibly. Install it once and run the configured Ruff, mypy --strict, and Basedpyright checks via:
uv tool install prek
prek install
prek run --all-files
prek run reads .pre-commit-config.yaml, so you can still target a subset of hooks or files during local development.
mise.toml at the repo root mirrors the common workflows, so you can rely on mise instead of remembering the raw commands. Trust the config once via mise trust mise.toml and then run, for example:
mise run lint
mise run mypy
mise run basedpyright
mise run test
FAQs
Asynchronous library for Telegram bot API
We found that aiotgbot 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.

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.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.