Skip to content

API reference

A component handler for hikari, built on Discord's Components V2.

A view is a class whose fields are its state, whose render returns its layout, and whose handlers answer the clicks on it. The state travels inside the message by default, so views survive restarts with no infrastructure. A view that outgrows the message can keep its state in a store.

Subpackages

  • risa.state

    Where a view's state lives, and which of its fields are state.

  • risa.state.placement

    Where a view keeps its durable state: InMessage or InStore.

  • risa.state.schema

    A view's durable fields, and how their values are packed into state.

  • risa.store

    Stores for InStore state: the Store protocol and the stores risa ships.

  • risa.store.memory

    MemoryStore, the store that keeps state in this process.

  • risa.store.postgres

    PostgresStore, a store on PostgreSQL. Install it with the [postgres] extra.

  • risa.store.protocol

    The contract a state store implements.

  • risa.store.redis

    RedisStore, a store on Redis. Install it with the [redis] extra.

  • risa.store.testing

    verify_store, the conformance check for Store implementations.

  • risa.ui

    The components a view's layout is built from, and Rendered, a built view.

  • risa.ui.build

    Building a view's layout into the components of a message.

  • risa.ui.nodes

    The components a view's layout is built from, Discord's Components V2.

Modules

  • risa.binding

    Putting handlers on components, with or without wire arguments.

  • risa.client

    The client that routes clicks to views, and the functions that make one.

  • risa.codecs

    How InMessage state is written into custom_id characters.

  • risa.context

    The contexts handlers and hooks answer interactions through.

  • risa.di

    Dependency injection for handlers, through linkd.

  • risa.errors

    The exceptions risa raises.

  • risa.view

    Views, their handlers, and how they are registered.

The names of risa.binding, risa.client, risa.context, risa.di, risa.errors, risa.state, risa.store and risa.view are also importable directly from risa.