config

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CIDLen          = 8
	DefaultInterval = 10
)

Variables

This section is empty.

Functions

func LogFile

func LogFile() (*os.File, error)

Types

type App

type App struct {
	Channels map[string]Channel `json:"channels"`
}

func Load

func Load() (*App, error)

func (*App) DeleteChatMessage

func (a *App) DeleteChatMessage(cid string, cm ChatMessage) error

func (*App) NewChannel

func (a *App) NewChannel(url string, name string) (string, error)

func (*App) NewChatMessage

func (a *App) NewChatMessage(cid string, cm ChatMessage) (string, error)

func (*App) Save

func (a *App) Save() error

func (*App) UpdateChatMessage

func (a *App) UpdateChatMessage(cid string, cm ChatMessage) (string, error)

type Channel

type Channel struct {
	ID       string        `json:"id"`
	ApiUrl   string        `json:"api_url"`
	Name     string        `json:"name"`
	Interval time.Duration `json:"interval"`
	ChatBot  ChatBot       `json:"chat_bot"`
}

type ChatBot

type ChatBot struct {
	Messages map[string]ChatMessage `json:"messages"`
	Session  ChatBotSession         `json:"session"`
}

type ChatBotSession added in v0.4.0

type ChatBotSession struct {
	Client   rumblelivestreamlib.NewClientOptions `json:"client"`
	Username string                               `json:"username"`
}

type ChatMessage

type ChatMessage struct {
	ID                  string        `json:"id"`
	AsChannel           bool          `json:"as_channel"`
	Command             string        `json:"command"`
	Interval            time.Duration `json:"interval"`
	OnCommand           bool          `json:"on_command"`
	OnCommandFollower   bool          `json:"on_command_follower"`
	OnCommandRantAmount int           `json:"on_command_rant_amount"`
	OnCommandSubscriber bool          `json:"on_command_subscriber"`
	Text                string        `json:"text"`
	TextFile            string        `json:"text_file"`
}

Jump to

Keyboard shortcuts

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