Skip to content

Commit

Permalink
command: consolidate definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
zephyrtronium committed Aug 22, 2024
1 parent 237a30a commit 90b0e6a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
15 changes: 14 additions & 1 deletion command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@ package command

import (
"context"
"log/slog"

"github.com/zephyrtronium/robot/brain"
"github.com/zephyrtronium/robot/channel"
"github.com/zephyrtronium/robot/message"
"github.com/zephyrtronium/robot/privacy"
"github.com/zephyrtronium/robot/spoken"
"github.com/zephyrtronium/robot/userhash"
)

// Robot is the bot state as is visible to commands.
type Robot struct {
Log *slog.Logger
Channels map[string]*channel.Channel // TODO(zeph): syncmap[string]channel.Channel
Brain brain.Brain
Privacy *privacy.List
Spoken *spoken.History
}

// Invocation is a command invocation. An Invocation and its fields must not
// be modified or retained by any command.
type Invocation struct {
Expand All @@ -22,5 +35,5 @@ type Invocation struct {
Hasher userhash.Hasher
}

// Func executes a command.
// Func is a command function.
type Func func(ctx context.Context, robo *Robot, call *Invocation)
19 changes: 0 additions & 19 deletions command/robot.go

This file was deleted.

0 comments on commit 90b0e6a

Please sign in to comment.