Skip to main content

logo with a label 'one bot codebase - multiple platforms'

seamless api for developing bots that run on multiple platforms. discord, telegram and twitch are supported

works with asyncio

learn more in the sections below or docs

install

install the base library:

pip install wiring

then choose extra dependencies for platforms that you want your bot to run on

pip install wiring[discord] wiring[telegram]

usage example

import asyncio

from wiring import (Bot, MultiPlatformMessage, MultiPlatformBot, MultiPlatformUser,
                    Command)
from wiring.platforms.discord import DiscordBot
from wiring.platforms.telegram import TelegramBot


DISCORD_TOKEN = 'place your token here or better load it from enviroment variables'
TELEGRAM_TOKEN = 'place your token here or better load it from enviroment variables'

async def send_commands_list(bot: Bot, message: MultiPlatformMessage,
                             args: list[str]):
    commands_list = '\n'.join(['/' + str(command.name) for command
                               in bot.commands])

    await bot.send_message(
        message.chat.id,
        'available commands:\n' + commands_list,
        reply_message_id=message.id
    )


async def start_bots():
    bot = MultiPlatformBot()

    bot.platform_bots = [
        DiscordBot(DISCORD_TOKEN),
        TelegramBot(TELEGRAM_TOKEN)
    ]

    async with bot:
        await bot.setup_commands([
            Command('help', send_commands_list)
        ])

        # blocks the execution
        await bot.listen_to_events()


asyncio.run(start_bots())

Metadata

Release files for wiring 0.1.2

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

Source distribution (sdist)

Source distribution for wiring 0.1.2
File Size Uploaded Provenance Actions
wiring-0.1.2.tar.gz 12.7 kB Without provenance Details for wiring-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wiring 0.1.2
File Interpreter ABI Platform Actions
wiring-0.1.2-py3-none-any.whl Python 3 none any Details for wiring-0.1.2-py3-none-any.whl

Total release size: 30.7 kB

Release files / wiring-0.1.2.tar.gz

Download URL wiring-0.1.2.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f71e551caa294f04fe082afbedc60175163935e0a0e2586610a3a611cce14db5
BLAKE2b-256 checksum
How to use checksums
30d9dd9e25d8e1ea77d279dcf2fcafd130416bae845fac25bf43a5b282eec38d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/5.15.0-118-generic

Release files / wiring-0.1.2-py3-none-any.whl

Download URL wiring-0.1.2-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b879f88469fe7d1397407df9310c8180eb9faa520c0303cb855288103f403c4a
BLAKE2b-256 checksum
How to use checksums
365cd758102ab84bc7042642e67a7aa738f3f1f25be05183f108f92677bf4b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.12 Linux/5.15.0-118-generic

Security for wiring 0.1.2

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