inform

package
v0.0.0-...-12606dc Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	ID      string
	Options Options
	Stories []*Story
}

func NewAuthor

func NewAuthor(id string) *Author

func (*Author) AddStory

func (a *Author) AddStory(name, path string) (*Story, error)

func (*Author) GetStory

func (a *Author) GetStory(name string) (*Story, error)

func (*Author) RemoveStory

func (a *Author) RemoveStory(name string) error

func (*Author) SetOption

func (a *Author) SetOption(name, value string) error

type Config

type Config struct {
	// Required attributes.
	Bot *joe.Bot // The bot handler.

	// Optional attributes.
	Inform7   string // The path to the `ni` Inform 7 compiler.
	Inform6   string // The path to the `inform6` Inform 6 compiler.
	DumbFrotz string // The path to the `dumb-frotz` interpreter.
}

type Inform

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

func New

func New(conf Config) (*Inform, error)

func (*Inform) Handle

func (n *Inform) Handle(ctx context.Context, ev joe.ReceiveMessageEvent) error

func (*Inform) SayTemplate

func (n *Inform) SayTemplate(channel string, template *template.Template, data interface{}) error

type Options

type Options struct {
	Prefix string
}

Options represent user-configurable values, which are used in processing commands and formatting output.

type Session

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

func NewSession

func NewSession(story *Story) (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) Error

func (s *Session) Error() error

func (*Session) Output

func (s *Session) Output() string

func (*Session) Run

func (s *Session) Run(cmd string) error

func (*Session) Start

func (s *Session) Start(ctx context.Context, conf *Config) error

type Story

type Story struct {
	Name      string    // The user-provided name for the story.
	AuthorID  string    // The author ID, corSayTemplates to Author.ID.
	CreatedAt time.Time // The UTC timestamp this story was first added on.
	UpdatedAt time.Time // The UTC timestamp this story was last updated on.

	// Source and compiled Z-Code for story.
	Source []byte
	Build  []byte
}

func NewStory

func NewStory(name, authorID string) *Story

func (*Story) Compile

func (s *Story) Compile(ctx context.Context, conf *Config) error

func (*Story) WithSource

func (s *Story) WithSource(src []byte) *Story

Jump to

Keyboard shortcuts

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