A Python API wrapper for Osmium.
Project description
osmium-chat
A Python API wrapper for Osmium.
[!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 restrictions —
CommandRestriction.NONE(default),DM_ONLY, orCOMMUNITY_ONLY - Rich text —
Bold,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
- Events —
connect,message,guild_message,dm_message,command_error
Documentation
Full API reference: osmium-chat.readthedocs.io
More examples in the examples/ directory.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file osmium_chat-0.1.5.tar.gz.
File metadata
- Download URL: osmium_chat-0.1.5.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb26cf1b51e0400fd3a303d644bd9f5bbf5ba10d0ae35ea5f7b65cf2bd5d0624
|
|
| MD5 |
4c08e75251c90a322b78e47cb18f7e08
|
|
| BLAKE2b-256 |
3acdda8b3264255260b9c01fc7ed9987c1060f0b8d65a22b859d70f60d473838
|
Provenance
The following attestation bundles were made for osmium_chat-0.1.5.tar.gz:
Publisher:
ci-cd.yml on ijsbol/osmium-chat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osmium_chat-0.1.5.tar.gz -
Subject digest:
eb26cf1b51e0400fd3a303d644bd9f5bbf5ba10d0ae35ea5f7b65cf2bd5d0624 - Sigstore transparency entry: 1704105599
- Sigstore integration time:
-
Permalink:
ijsbol/osmium-chat@4846c427a6e4d78c89b03a8d5ee483bc95a9fba7 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ijsbol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@4846c427a6e4d78c89b03a8d5ee483bc95a9fba7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file osmium_chat-0.1.5-py3-none-any.whl.
File metadata
- Download URL: osmium_chat-0.1.5-py3-none-any.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caede2d1a6938505ac22febe5f4efa4d0ec0c8f8b274d2b86188ab47be539eb1
|
|
| MD5 |
217f94f94bc6c2ec2935c8c6a4c852f1
|
|
| BLAKE2b-256 |
572cd13933f89056593a18e291367f8ccc570b70bf08d59c6434e6bd74aefef2
|
Provenance
The following attestation bundles were made for osmium_chat-0.1.5-py3-none-any.whl:
Publisher:
ci-cd.yml on ijsbol/osmium-chat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
osmium_chat-0.1.5-py3-none-any.whl -
Subject digest:
caede2d1a6938505ac22febe5f4efa4d0ec0c8f8b274d2b86188ab47be539eb1 - Sigstore transparency entry: 1704105622
- Sigstore integration time:
-
Permalink:
ijsbol/osmium-chat@4846c427a6e4d78c89b03a8d5ee483bc95a9fba7 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ijsbol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci-cd.yml@4846c427a6e4d78c89b03a8d5ee483bc95a9fba7 -
Trigger Event:
release
-
Statement type: