Skip to main content

Roboto

codecov

A type-hinted async Telegram bot library, supporting trio, curio and asyncio.

Roboto's API is not perfectly stable nor complete yet. It will be kept a 0.x.0 until the Telegram Bot API is completely implemented, and will be bumped to 1.0.0 when it is complete.

Basic usage

Roboto is still a low-level bot API, meaning it does not provide much abstraction over the Bot API yet (that is planned, though).

Currently, a basic echo bot with roboto looks like:

from roboto import Token, BotAPI
from trio import run  # This could be asyncio or curio as well!


api_token = Token('your-bot-token')


async def main() -> None:
    async with BotAPI.make(api_token) as bot:
        offset = 0

        while True:
            updates = await bot.get_updates(offset)

            for update in updates:
                if update.message is not None and update.message.text is not None:
                    await bot.send_message(
                        update.message.chat.id,
                        update.message.text,
                    )

            if updates:
                offset = updates[-1].update_id + 1


# In asyncio it should be "main()".
run(main)

Being statically-typed, Roboto supports easy autocompletion and mypy static checking.

Contributing

Check our contributing guide to know how to develop on Roboto and contribute to our project.

Goals

Principles

  • Ease of static checking for client code, especially static typing.
  • Forwards compatibility (additions to the bot HTTP API should not break older versions of Roboto easily).

Achieved milestones

Next milestones

Acknowledgements

This used to be a disclaimer that we were vendoring asks. We are not anymore (the feature we needed is now on upstream), but I will still keep the acknowledgemente because it (through anyio) gives us the ability to support the three major async event loops, asyncio, trio and curio!

Metadata

Release files for roboto-telegram 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for roboto-telegram 0.4.0
File Size Uploaded Provenance
roboto-telegram-0.4.0.tar.gz 24.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for roboto-telegram 0.4.0
File Interpreter ABI Platform
roboto_telegram-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.5 kB

Release files / roboto-telegram-0.4.0.tar.gz

Download URL roboto-telegram-0.4.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c0d772d84f757cdbd1601a26e1eaff330dc52a3378ba7a2964bd9962f98a9302
BLAKE2b-256 checksum
How to use checksums
6353848498fd45873ba8536d2f2695086b221f15f78c5576d524d19e103774fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.3 Linux/5.6.15-arch1-1

Release files / roboto_telegram-0.4.0-py3-none-any.whl

Download URL roboto_telegram-0.4.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13163bcdf63ba80a20257939e5ac29a1dc3efac4a0f41ac05d150415acd82469
BLAKE2b-256 checksum
How to use checksums
e45c2cd6b70c5af619c0fafb6cd0d52c380c19d092873e78cd56d91ea5e0ad42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.3 Linux/5.6.15-arch1-1

Security for roboto-telegram 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page