Skip to main content

Universal Push Service

Project description

omniunibot

🤖 An omnipotent universal message bot library for python

  • Supported platforms
    • Feishu
    • Slack
    • Dingtalk
  • Features
    • Non-blocking mode for sending messages
    • Send to multiple platforms with one-line code

📜 Run via docker (Recommended)

  1. Prepare a config file, for example

    {
        "channel_groups": {
            "test_channels": [
                {
                    "platform": "Slack",
                    "webhook": "https://hooks.slack.com/services/xxxx/xxxx/xxxx"
                },
                {
                    "platform": "Lark",
                    "webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/1a166e72-xxxx-xxxx-xxxx-3ae4f0fb51b7",
                    "secret": "xxx"
                },
                {
                    "platform": "DingTalk",
                    "webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxx",
                    "secret": "xxx"
                }
            ]
        },
        "debug": true
    }
    
  2. Set environment export OMNI_CONFIG=<path to the config file>

  3. Use docker to start the bot server

    docker compose up -d --build
    
  4. Use the client-side code in your code (see examples in demo_client)

📜 Standalone Mode

bot = DingTalkBot(
    "https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxxxxxxx",
    "xxxxxxxxxxxxxx",
    on_success="log",
    on_failure="trace",
)
await bot.send({"text": "`test_dingtalkbot_1` Pass"})

bot = LarkBot(
    "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx-d879-xxxxx-8d7b-xxxxxxxxxx",
    "xxxxxxxxxxxxxxx",
    on_success="log",
    on_failure="trace",
)
await bot.send({"text": "`test_larkbot_1` Pass"})

bot = SlackBot(
    "https://hooks.slack.com/services/xxxxxxxx/xxxxxxxx/xxxxxxxxxx",
    on_success="log",
    on_failure="trace",
)
await bot.send({"text": "`test_slackbot_1` Pass"})

Release notes

  • For omniunibot (>=0.6.0), it is highly recommended to run via docker compose.
  • For omniunibot (>=0.3.0,<0.5.0), omniunibot will only support Python>=3.12.
  • Please use omniunibot==0.2.0 for Python<3.12.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omniunibot-0.6.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omniunibot-0.6.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file omniunibot-0.6.0.tar.gz.

File metadata

  • Download URL: omniunibot-0.6.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for omniunibot-0.6.0.tar.gz
Algorithm Hash digest
SHA256 abcd4d8b2d6b6cb4350a255cc47abe992b0cc0426becc201af2731639d2ea3c1
MD5 37047d9a18aaadf627a410cc07a81814
BLAKE2b-256 4a07dc371021e5b4662b0689a42a1c5b15c51b42ed29f6913dbde296701756bd

See more details on using hashes here.

File details

Details for the file omniunibot-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: omniunibot-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.12 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for omniunibot-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b62c393c630dda858283b320aba6d63bdc44072f9a6922e68981e076f5785ca5
MD5 be5d76f3a2036ddd888312293f4c6b08
BLAKE2b-256 f880e9e9ab584f18c441093b8cff772be6f3f36efb23559edb16cfcd22d00635

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page