Skip to content

sashaiw/robotkirby

Repository files navigation

Robot Kirby

Robot Kirby is a Discord bot that can imitate specific users, channels, or servers, based on a Markov chain model. Users must opt in for their data to be collected using the /opt in command.

Robot Kirby uses Hikari and Tanjun for interacting with the Discord API, MongoDB as a database, and Markovify for the Markov chain model.

Credit to Amelia for the idea for the /timedensity command! The /rankedopinion command was written by Amelia and the /similarity command was written by Jenna.

How to run

Make a file called .env in the root directory with the following contents:

DISCORD_TOKEN=<your token from the Discord API developer portal>

Then, start the Docker containers: docker compose up

Discord Permissions & Intents

  • Required scopes: bot, applications.commands.
  • Gateway intents (Developer Portal → Bot → Privileged Gateway Intents):
    • Message Content
    • Presence
    • Server Members
  • Guild permissions (when inviting):
    • View Channels
    • Send Messages
    • Attach Files
    • Embed Links
    • Read Message History

CI & Local Checks

This repo uses GitHub Actions to enforce code quality on every PR and push to master:

  • Formatting: ruff format then ruff check --fix (fails if changes are needed).
  • Type checking: pyright.

You can run the same checks locally with uv.

Install uv

uv is a fast Python package and environment manager from Astral.

  • macOS/Linux (script): curl -LsSf https://astral.sh/uv/install.sh | sh
  • macOS (Homebrew): brew install uv

After installing, restart your shell so uv is on your PATH.

Install Task (optional)

Task is a simple task runner used by Taskfile.yml for common dev commands. Install it if you want to use the provided tasks:

  • macOS (Homebrew): brew install go-task
  • macOS/Linux (script): sh -c "$(curl -sSL https://taskfile.dev/install.sh)" -- -d

Verify: task --version

Set up the dev environment

From the repo root:

  1. Create a virtual environment: uv venv

  2. Activate it: source .venv/bin/activate

  3. Install dependencies (including dev tools like Ruff and Pyright):

    • uv sync --group dev

Run checks locally

  • Format and autofix: uv run ruff format && uv run ruff check --fix
  • Type check: uv run pyright
  • Lint only (no fixes): uv run ruff check

If you use Taskfile (optional), the following are equivalent:

  • task format → runs Ruff format and autofix
  • task typecheck → runs Pyright for type checking

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors