Skip to main content

A Python API wrapper for Osmium.

Project description

osmium-chat

A Python API wrapper for Osmium.

enbyware

[!NOTE] the documentation was ai-assisted as i suck at writing documentation lol


Installation

pip install osmium-chat

Requires Python 3.13+.


Quick start

from osmium_chat import Bot, Context
from osmium_chat.commands import CommandRestriction

bot = Bot(prefix="!", client_id=YOUR_CLIENT_ID)


@bot.on("connect")
async def on_connect() -> None:
    print("Connected!")


@bot.command("ping")
async def ping(ctx: Context) -> None:
    await ctx.channel.send("Pong!")


@bot.command("say", restriction=CommandRestriction.COMMUNITY_ONLY)
async def say(ctx: Context, *, words: str) -> None:
    await ctx.channel.send(words)


bot.run(token="YOUR_TOKEN")

Rich text formatting

from osmium_chat.content import Bold, CodeBlock, Content, Italic, Spoiler, TextUrl

await ctx.channel.send(Content(
    f"Hello, {Bold('world')}! ",
    TextUrl("osmium.chat", url="https://osmium.chat"),
))

Features

  • Commands — prefix-based command routing with automatic argument parsing and type conversion
  • Command restrictionsCommandRestriction.NONE (default), DM_ONLY, or COMMUNITY_ONLY
  • Rich textBold, Italic, Underline, Code, CodeBlock, Spoiler, TextUrl, and more
  • Communities — create/manage channels, categories, and roles
  • Invites — create, list, look up, and revoke invite links
  • File attachments — upload files from bytes, download and save attachments to disk
  • Eventsconnect, message, guild_message, dm_message, command_error

Documentation

Full API reference: osmium-chat.readthedocs.io

More examples in the examples/ directory.


Links

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

osmium_chat-0.3.4.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

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

osmium_chat-0.3.4-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file osmium_chat-0.3.4.tar.gz.

File metadata

  • Download URL: osmium_chat-0.3.4.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for osmium_chat-0.3.4.tar.gz
Algorithm Hash digest
SHA256 a0224dd4834d0c5e28cffd56da79f8392d3f7e9dfc73ad1c1ea73dcab3275bbd
MD5 c8f4a90ca723053ce6fcd8bc3d2bd78e
BLAKE2b-256 7a7bcd5da7a143f46cd7d39aff3749c28de7117db54ffa9eb9708639de281aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for osmium_chat-0.3.4.tar.gz:

Publisher: ci-cd.yml on ijsbol/osmium-chat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file osmium_chat-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: osmium_chat-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for osmium_chat-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a44f98fb17cd0be871c325fbf189e74766b1a23e90b69ff77174f5dd6d6f93d1
MD5 ecd3846b4d65167697270126efa5ad95
BLAKE2b-256 14a54d5a4f579fee5db765476151627ff8c1ebfcb5d5d1ef860baa933249a3d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for osmium_chat-0.3.4-py3-none-any.whl:

Publisher: ci-cd.yml on ijsbol/osmium-chat

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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