registry

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugins = map[string]MuxPlugin{}

Plugins contains a list of loaded plugins

Functions

func LoadConfig

func LoadConfig(configPath string)

LoadConfig reads configuration into registry.Config

func RegisterPlugin

func RegisterPlugin(p MuxPlugin)

RegisterPlugin

Types

type Configuration

type Configuration struct {
	TelegramKey         string                  `yaml:"telegram_key"`
	ReplyTechLink       string                  `yaml:"reply_tech_link"`
	NametriggerConfig   NametriggerPluginConfig `yaml:"nametrigger"`
	Birthdays           map[string]string       `yaml:"birthdays"`
	TimeZone            string                  `yaml:"time_zone"`
	TimeLoc             *time.Location
	DupeIgnoredDomains  []string `yaml:"dupe_ignored_domains"`
	TwitchAPIKey        string   `yaml:"twitch_api_key"`
	TwitchAPISecret     string   `yaml:"twitch_api_secret"`
	TwitchStreams       []string `yaml:"twitch_streams"`
	OpenaiApiKey        string   `yaml:"openai_api_key"`
	ChatGptUseHistory   bool     `yaml:"chat_gpt_use_history"`
	ChatGptSystemPrompt string   `yaml:"chat_gpt_system_prompt"`
	ChatGptUserPrompt   string   `yaml:"chat_gpt_user_prompt"`
	ChatGptHistoryDepth int      `yaml:"chat_gpt_history_depth"`
}

Configuration stores a struct loaded from config.yml

var Config Configuration

type MuxPlugin

type MuxPlugin interface {
	Start(sharedDb *storm.DB)
	Process(message *telebot.Message)
}

MuxPlugin is a basic plugin interface

type NametriggerPluginConfig

type NametriggerPluginConfig struct {
	Triggers []Trigger `yaml:"triggers"`
}

type Trigger

type Trigger struct {
	Usernames []string
	Chance    int
	Reply     string
}

Jump to

Keyboard shortcuts

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