command

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AAAAA

func AAAAA(ctx context.Context, robo *Robot, call *Invocation)

AAAAA AAAAAAAAA A AAAAAAA.

func Affection

func Affection(ctx context.Context, robo *Robot, call *Invocation)

Affection describes the caller's affection MMR. No arguments.

func Contact

func Contact(ctx context.Context, robo *Robot, call *Invocation)

Contact gives information on how to contact the bot owner.

func DescribeMarriage

func DescribeMarriage(ctx context.Context, robo *Robot, call *Invocation)

DescribeMarriage gives some exposition about the marriage system. No args.

func DescribePrivacy

func DescribePrivacy(ctx context.Context, robo *Robot, call *Invocation)

func Echo

func Echo(ctx context.Context, robo *Robot, call *Invocation)

Echo sends a plain text message to the channel in which it is invoked.

  • msg: Message to send.

func EchoIn

func EchoIn(ctx context.Context, robo *Robot, call *Invocation)

EchoIn sends a plain text message to any channel.

  • in: Name of the channel to send to.
  • msg: Message to send.

func Effect

func Effect(log *slog.Logger, name, msg string) string

Effect applies an effect to a message. The currently available effects include "OwO", "AAAAA", "o", "hte", and "". Names are not case sensitive.

func Forget

func Forget(ctx context.Context, robo *Robot, call *Invocation)

func Hte

func Hte(ctx context.Context, robo *Robot, call *Invocation)

Hte generats an typod message.

  • prompt: Start of the message to use. Optional.

func Marry

func Marry(ctx context.Context, robo *Robot, call *Invocation)

Marry proposes to the robo.

  • partnership: Type of partnership requested, e.g. "wife", "waifu", "daddy". Optional.

func OwO

func OwO(ctx context.Context, robo *Robot, call *Invocation)

OwO genyewates an uwu message.

  • prompt: Start of the message to use. Optional.

func Private

func Private(ctx context.Context, robo *Robot, call *Invocation)

func Quiet

func Quiet(ctx context.Context, robo *Robot, call *Invocation)

Quiet makes the bot temporarily stop learning and speaking in the channel.

  • dur: Duration to stop learning and speaking. Optional.
  • until: Marker to stop "until tomrrow" if not empty. Optional.

NOTE(zeph): Quiet waits for a timer which can be up to twelve hours.

func Rawr

func Rawr(ctx context.Context, robo *Robot, call *Invocation)

Rawr says rawr.

func Source

func Source(ctx context.Context, robo *Robot, call *Invocation)

Source gives a link to the source code.

func Speak

func Speak(ctx context.Context, robo *Robot, call *Invocation)

Speak generates a message.

  • prompt: Start of the message to use. Optional.

func Unprivate

func Unprivate(ctx context.Context, robo *Robot, call *Invocation)

func Who

func Who(ctx context.Context, robo *Robot, call *Invocation)

Who describes Robot.

Types

type Func

type Func func(ctx context.Context, robo *Robot, call *Invocation)

Func is a command function.

type Invocation

type Invocation struct {
	// Channel is the channel where the invocation occurred.
	Channel *channel.Channel
	// Message is the message which triggered the invocation with the platform
	// user ID as the type argument.
	// It is always non-nil, but not all fields are guaranteed to be populated.
	Message *message.Received[message.User]
	// Args is the parsed arguments to the command.
	Args map[string]string
}

Invocation is a command invocation. An Invocation and its fields must not be modified or retained by any command.

type Robot

type Robot struct {
	Log      *slog.Logger
	Channels *syncmap.Map[string, *channel.Channel]
	Brain    brain.Interface
	Privacy  *privacy.List
	Spoken   *spoken.History
	Owner    string
	Contact  string
	Metrics  *metrics.Metrics
}

Robot is the bot state as is visible to commands.

Jump to

Keyboard shortcuts

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