OneBot is an IRC bot based on irc3.
This project uses uv for dependency management and ruff for code style.
- Python 3.11+
uv(https://github.com/astral-sh/uv)
- Sync dependencies:
This creates a virtual environment and installs all dependencies (including dev dependencies).
uv sync
We use ruff for linting and formatting. Ensure all code is compliant before committing.
- Check code:
uv run ruff check . - Format code:
uv run ruff format .
Tests are written using pytest.
- Run tests:
uv run pytest
- Run full test suite (multi-environment):
This uses
uv run tox
tox-uvto test across supported Python versions.
onebot/: Main package source code.plugins/: OneBot plugins (features likelastfm,trakt,wolframalpha, etc.).__init__.py: Entry point (runfunction).
tests/: Test suite.fixtures/: Test data (betamax cassettes, JSON responses).
docs/: Sphinx documentation.pyproject.toml: Project configuration, dependencies, and tool settings.
uv add <package_name>- Create a new file in
onebot/plugins/. - Implement the plugin class decorated with
@irc3.plugin. - Add tests in
tests/.
cd docs
make html