diff --git a/command/command.go b/command/command.go index 1fd334b..ec9e745 100644 --- a/command/command.go +++ b/command/command.go @@ -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 { @@ -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) diff --git a/command/robot.go b/command/robot.go deleted file mode 100644 index 885a6bd..0000000 --- a/command/robot.go +++ /dev/null @@ -1,19 +0,0 @@ -package command - -import ( - "log/slog" - - "github.com/zephyrtronium/robot/brain" - "github.com/zephyrtronium/robot/channel" - "github.com/zephyrtronium/robot/privacy" - "github.com/zephyrtronium/robot/spoken" -) - -// 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 -}