discord

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package discord provides a Discord bot interface for Chronos agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	// contains filtered or unexported fields
}

Bot is a Discord bot that listens for messages and routes them to an agent.

func New

func New(token string, handler MessageHandler) *Bot

New creates a new Discord bot. token is the Discord Bot token. handler is called for each incoming message.

func (*Bot) HandleInteraction

func (b *Bot) HandleInteraction(w http.ResponseWriter, r *http.Request)

HandleInteraction processes Discord Gateway interaction events. This is designed to be called from a webhook handler.

func (*Bot) SendMessage

func (b *Bot) SendMessage(ctx context.Context, channelID, content string) error

SendMessage sends a message to a Discord channel.

func (*Bot) Stop

func (b *Bot) Stop()

Stop signals the bot to shut down.

type MessageHandler

type MessageHandler func(ctx context.Context, channelID, userID, content string) (string, error)

MessageHandler processes incoming messages and returns a response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL