Menu ▾ ▴

Plugin API

thororen
There is a newer version of this page. You can find it here.

Equicord Plugin API Reference

Equicord provides a robust and convenient API layer to accelerate plugin development. It simplifies state management, layout rendering, context menu patches, and command registration.


Core Components

  • Plugin Settings: Created via definePluginSettings to output a reactive state store. Settings must be registered inside your main definition block to avoid runtime crashes. Components can cleanly subscribe to individual option changes dynamically.
  • Slash Commands: Integrated directly by declaring configurations inside the commands array. The API supports core command functionalities, execution callbacks, arguments, and sub-commands out of the box.
  • Context Menus: Registered through the contextMenus object by matching target interface IDs. It allows developers to seamlessly push custom action components onto existing context trays.

Interface UI Additions

  • Chat Bar Buttons: Appends custom interactive buttons inside the native text input utility bar alongside default stickers and emojis.
  • Message Popover Buttons: Mounts custom short-action utilities directly onto the popover deck that surfaces when hovering over chat items.
  • Message Accessories: Injects structural layout extensions directly beneath message rows. This provides a clean method for drawing custom embeddings or rich text metrics.
  • Interface Decorations: Custom nodes can be dynamically appended to metadata areas. This includes message decorations positioned beside message author credits or structural rows inside the channel member list.

Lifecycle Event Listeners

  • onMessageClick: Triggers targeted logic blocks immediately when a user clicks an active message element.
  • onBeforeMessageSend: Intercepts, formats, or processes text payloads immediately prior to dispatching them to the gateway.
  • onBeforeMessageEdit: Evaluates and processes message edits before the update event commits to the active view channel.