Skip to main content

A robust, low-level connector for the Discord API

Project description

Bauxite

Bauxite is a robust, low-level connector for the Discord API.

What is Bauxite for?

Bauxite is made for two main purposes:

  • Creating higher-level API wrappers and frameworks
  • Creating things that need high levels of control and low-level access to the Discord API

Examples

Basic HTTP Example

from asyncio import run

from bauxite import HTTPClient, Route


async def main() -> None:
    client = HTTPClient("your_bot_token")

    await client.request(
        Route("POST", "/channels/{channel_id}/messages", channel_id=1234),
        json={
            "content": "Hello, world!",
        },
    )

    await client.close()

run(main())

Basic Gateway Example

from asyncio import run

from bauxite import GatewayClient, HTTPClient


async def callback(shard, direction, data) -> None:
    print(f"{shard} [{direction}]: {data['op'] or data['t']}")

async def main() -> None:
    client = HTTPClient("your_bot_token")
    gateway = GatewayClient(client, 32767, callbacks=[callback])

    await gateway.spawn_shards()

run(main())

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

bauxite-1.0.2.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

bauxite-1.0.2-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file bauxite-1.0.2.tar.gz.

File metadata

  • Download URL: bauxite-1.0.2.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.15.5-arch1-1

File hashes

Hashes for bauxite-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ad0a71db39e43f1cc88c872fbc662fc84403bb00dc4598214f5e99123f56a37e
MD5 13b99724cf324d6430babeef21d845c3
BLAKE2b-256 eda4c877e53e316e87a28863f3c5fd7312614973eafac7f9b7ffbf78df1e3c3b

See more details on using hashes here.

File details

Details for the file bauxite-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: bauxite-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Linux/5.15.5-arch1-1

File hashes

Hashes for bauxite-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f4369e564b4a7094163653bb96b48e7d6e8bf5848f9ff74291c9df472ebd5bb
MD5 eb1a61b731278548f884a91324a90b2c
BLAKE2b-256 a3df62cec95e7e8f794707972a649171e4b948607ea23e73755037258a26a17b

See more details on using hashes here.

Supported by

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