client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(flapc FlapClient, screenName string, password string) (string, string, error)

Authenticate performs the BUCP auth flow with the OSCAR auth server. Upon successful login, it returns a host name and auth cookie for connecting to and authenticating with the BOS service.

func Chat

func Chat(logger *slog.Logger, flapc FlapClient, authCookie string, chatBot ChatBot, config config.Config) error

Chat handles conversations with multiple users.

Types

type ChatBot

type ChatBot interface {
	ExchangeMessage(send string, exchange [2]string) (receive string, err error)
}

type FlapClient

type FlapClient interface {
	ReceiveFLAP() (frame wire.FLAPFrame, body *bytes.Buffer, err error)
	ReceiveSNAC(frame *wire.SNACFrame, body any) error
	ReceiveSignonFrame() (wire.FLAPSignonFrame, error)
	SendSNAC(frame wire.SNACFrame, body any) error
	SendSignonFrame(tlvs []wire.TLV) error
}

Jump to

Keyboard shortcuts

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