banter

package module
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: MIT Imports: 25 Imported by: 1

Documentation

Overview

Package banter provides automation for Twitch chat.

Index

Constants

View Source
const (
	// EnvLocalContentPath specifies an env var that, if set, provides a path
	// to serve web content from instead of the embedded zip
	EnvLocalContentPath = "AK_CONTENT_BANTER"
)

Variables

View Source
var (
	BusTopic_name = map[int32]string{
		0: "BANTER_EVENT",
		1: "BANTER_REQUEST",
		2: "BANTER_COMMAND",
	}
	BusTopic_value = map[string]int32{
		"BANTER_EVENT":   0,
		"BANTER_REQUEST": 1,
		"BANTER_COMMAND": 2,
	}
)

Enum value maps for BusTopic.

View Source
var (
	MessageTypeRequest_name = map[int32]string{
		0: "CONFIG_GET_REQ",
		1: "CONFIG_GET_RESP",
	}
	MessageTypeRequest_value = map[string]int32{
		"CONFIG_GET_REQ":  0,
		"CONFIG_GET_RESP": 1,
	}
)

Enum value maps for MessageTypeRequest.

View Source
var (
	MessageTypeCommand_name = map[int32]string{
		0: "CONFIG_SET_REQ",
		1: "CONFIG_SET_RESP",
	}
	MessageTypeCommand_value = map[string]int32{
		"CONFIG_SET_REQ":  0,
		"CONFIG_SET_RESP": 1,
	}
)

Enum value maps for MessageTypeCommand.

View Source
var File_banter_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Banter

type Banter struct {
	Command  string `protobuf:"bytes,1,opt,name=command,proto3" json:"command,omitempty"`
	Text     string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Disabled bool   `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"`
	Random   bool   `protobuf:"varint,4,opt,name=random,proto3" json:"random,omitempty"`
	// contains filtered or unexported fields
}

func (*Banter) Descriptor deprecated

func (*Banter) Descriptor() ([]byte, []int)

Deprecated: Use Banter.ProtoReflect.Descriptor instead.

func (*Banter) GetCommand

func (x *Banter) GetCommand() string

func (*Banter) GetDisabled

func (x *Banter) GetDisabled() bool

func (*Banter) GetRandom

func (x *Banter) GetRandom() bool

func (*Banter) GetText

func (x *Banter) GetText() string

func (*Banter) ProtoMessage

func (*Banter) ProtoMessage()

func (*Banter) ProtoReflect

func (x *Banter) ProtoReflect() protoreflect.Message

func (*Banter) Reset

func (x *Banter) Reset()

func (*Banter) String

func (x *Banter) String() string

type Banterer

type Banterer struct {
	http.Handler

	modutil.ModuleBase
	// contains filtered or unexported fields
}

Banterer is the module

func (*Banterer) Start

func (bb *Banterer) Start(ctx context.Context, deps *modutil.ModuleDeps) error

Start banter

type BusTopic

type BusTopic int32
const (
	BusTopic_BANTER_EVENT   BusTopic = 0
	BusTopic_BANTER_REQUEST BusTopic = 1
	BusTopic_BANTER_COMMAND BusTopic = 2
)

func (BusTopic) Descriptor

func (BusTopic) Descriptor() protoreflect.EnumDescriptor

func (BusTopic) Enum

func (x BusTopic) Enum() *BusTopic

func (BusTopic) EnumDescriptor deprecated

func (BusTopic) EnumDescriptor() ([]byte, []int)

Deprecated: Use BusTopic.Descriptor instead.

func (BusTopic) Number

func (x BusTopic) Number() protoreflect.EnumNumber

func (BusTopic) String

func (x BusTopic) String() string

func (BusTopic) Type

type Config

type Config struct {
	IntervalSeconds uint32         `protobuf:"varint,1,opt,name=interval_seconds,json=intervalSeconds,proto3" json:"interval_seconds,omitempty"`
	CooldownSeconds uint32         `protobuf:"varint,2,opt,name=cooldown_seconds,json=cooldownSeconds,proto3" json:"cooldown_seconds,omitempty"`
	Banters         []*Banter      `protobuf:"bytes,3,rep,name=banters,proto3" json:"banters,omitempty"`
	ChannelRaid     *EventSettings `protobuf:"bytes,4,opt,name=channel_raid,json=channelRaid,proto3" json:"channel_raid,omitempty"`
	ChannelFollow   *EventSettings `protobuf:"bytes,5,opt,name=channel_follow,json=channelFollow,proto3" json:"channel_follow,omitempty"`
	ChannelCheer    *EventSettings `protobuf:"bytes,6,opt,name=channel_cheer,json=channelCheer,proto3" json:"channel_cheer,omitempty"`
	// contains filtered or unexported fields
}

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetBanters

func (x *Config) GetBanters() []*Banter

func (*Config) GetChannelCheer

func (x *Config) GetChannelCheer() *EventSettings

func (*Config) GetChannelFollow

func (x *Config) GetChannelFollow() *EventSettings

func (*Config) GetChannelRaid

func (x *Config) GetChannelRaid() *EventSettings

func (*Config) GetCooldownSeconds

func (x *Config) GetCooldownSeconds() uint32

func (*Config) GetIntervalSeconds

func (x *Config) GetIntervalSeconds() uint32

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

func (*Config) Validate

func (cfg *Config) Validate() error

Validate Banter's config

type ConfigGetRequest

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

func (*ConfigGetRequest) Descriptor deprecated

func (*ConfigGetRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConfigGetRequest.ProtoReflect.Descriptor instead.

func (*ConfigGetRequest) ProtoMessage

func (*ConfigGetRequest) ProtoMessage()

func (*ConfigGetRequest) ProtoReflect

func (x *ConfigGetRequest) ProtoReflect() protoreflect.Message

func (*ConfigGetRequest) Reset

func (x *ConfigGetRequest) Reset()

func (*ConfigGetRequest) String

func (x *ConfigGetRequest) String() string

type ConfigGetResponse

type ConfigGetResponse struct {
	Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigGetResponse) Descriptor deprecated

func (*ConfigGetResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConfigGetResponse.ProtoReflect.Descriptor instead.

func (*ConfigGetResponse) GetConfig

func (x *ConfigGetResponse) GetConfig() *Config

func (*ConfigGetResponse) ProtoMessage

func (*ConfigGetResponse) ProtoMessage()

func (*ConfigGetResponse) ProtoReflect

func (x *ConfigGetResponse) ProtoReflect() protoreflect.Message

func (*ConfigGetResponse) Reset

func (x *ConfigGetResponse) Reset()

func (*ConfigGetResponse) String

func (x *ConfigGetResponse) String() string

type ConfigSetRequest

type ConfigSetRequest struct {
	Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigSetRequest) Descriptor deprecated

func (*ConfigSetRequest) Descriptor() ([]byte, []int)

Deprecated: Use ConfigSetRequest.ProtoReflect.Descriptor instead.

func (*ConfigSetRequest) GetConfig

func (x *ConfigSetRequest) GetConfig() *Config

func (*ConfigSetRequest) ProtoMessage

func (*ConfigSetRequest) ProtoMessage()

func (*ConfigSetRequest) ProtoReflect

func (x *ConfigSetRequest) ProtoReflect() protoreflect.Message

func (*ConfigSetRequest) Reset

func (x *ConfigSetRequest) Reset()

func (*ConfigSetRequest) String

func (x *ConfigSetRequest) String() string

type ConfigSetResponse

type ConfigSetResponse struct {
	Config *Config `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigSetResponse) Descriptor deprecated

func (*ConfigSetResponse) Descriptor() ([]byte, []int)

Deprecated: Use ConfigSetResponse.ProtoReflect.Descriptor instead.

func (*ConfigSetResponse) GetConfig

func (x *ConfigSetResponse) GetConfig() *Config

func (*ConfigSetResponse) ProtoMessage

func (*ConfigSetResponse) ProtoMessage()

func (*ConfigSetResponse) ProtoReflect

func (x *ConfigSetResponse) ProtoReflect() protoreflect.Message

func (*ConfigSetResponse) Reset

func (x *ConfigSetResponse) Reset()

func (*ConfigSetResponse) String

func (x *ConfigSetResponse) String() string

type EventSettings

type EventSettings struct {
	Enabled bool   `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Text    string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*EventSettings) Descriptor deprecated

func (*EventSettings) Descriptor() ([]byte, []int)

Deprecated: Use EventSettings.ProtoReflect.Descriptor instead.

func (*EventSettings) GetEnabled

func (x *EventSettings) GetEnabled() bool

func (*EventSettings) GetText

func (x *EventSettings) GetText() string

func (*EventSettings) ProtoMessage

func (*EventSettings) ProtoMessage()

func (*EventSettings) ProtoReflect

func (x *EventSettings) ProtoReflect() protoreflect.Message

func (*EventSettings) Reset

func (x *EventSettings) Reset()

func (*EventSettings) String

func (x *EventSettings) String() string

type MessageTypeCommand

type MessageTypeCommand int32
const (
	MessageTypeCommand_CONFIG_SET_REQ  MessageTypeCommand = 0
	MessageTypeCommand_CONFIG_SET_RESP MessageTypeCommand = 1
)

func (MessageTypeCommand) Descriptor

func (MessageTypeCommand) Enum

func (MessageTypeCommand) EnumDescriptor deprecated

func (MessageTypeCommand) EnumDescriptor() ([]byte, []int)

Deprecated: Use MessageTypeCommand.Descriptor instead.

func (MessageTypeCommand) Number

func (MessageTypeCommand) String

func (x MessageTypeCommand) String() string

func (MessageTypeCommand) Type

type MessageTypeRequest

type MessageTypeRequest int32
const (
	MessageTypeRequest_CONFIG_GET_REQ  MessageTypeRequest = 0
	MessageTypeRequest_CONFIG_GET_RESP MessageTypeRequest = 1
)

func (MessageTypeRequest) Descriptor

func (MessageTypeRequest) Enum

func (MessageTypeRequest) EnumDescriptor deprecated

func (MessageTypeRequest) EnumDescriptor() ([]byte, []int)

Deprecated: Use MessageTypeRequest.Descriptor instead.

func (MessageTypeRequest) Number

func (MessageTypeRequest) String

func (x MessageTypeRequest) String() string

func (MessageTypeRequest) Type

Jump to

Keyboard shortcuts

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