eribo

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCustomCommand added in v1.3.0

func ParseCustomCommand(s string) (cmd string, args []string)

Types

type ChannelMap added in v1.3.0

type ChannelMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewChannelMap added in v1.3.0

func NewChannelMap() *ChannelMap

func (*ChannelMap) ChooseLoth added in v1.3.0

func (c *ChannelMap) ChooseLoth(playerName, channel, botName string, d time.Duration, lowNames []string) (*Loth, bool, []*Player)

func (*ChannelMap) DelPlayer added in v1.3.0

func (c *ChannelMap) DelPlayer(channel, playerName string)

func (*ChannelMap) DelPlayerAllChannels added in v1.3.0

func (c *ChannelMap) DelPlayerAllChannels(playerName string)

func (*ChannelMap) Find added in v1.7.0

func (c *ChannelMap) Find(playerName, channelName string) []*Player

func (*ChannelMap) ForEach added in v1.3.0

func (c *ChannelMap) ForEach(fn func(channel string, pm *PlayerMap))

func (*ChannelMap) GetActivePlayers added in v1.3.0

func (c *ChannelMap) GetActivePlayers() *PlayerMap

func (*ChannelMap) GetChannel added in v1.3.0

func (c *ChannelMap) GetChannel(channel string) (*PlayerMap, bool)

func (*ChannelMap) GetPlayer added in v1.3.0

func (c *ChannelMap) GetPlayer(playerName string) (*Player, []string)

func (*ChannelMap) Loth added in v1.5.2

func (c *ChannelMap) Loth(channel string) *Loth

func (*ChannelMap) PlayerMap added in v1.7.0

func (c *ChannelMap) PlayerMap(channel string) (*PlayerMap, bool)

func (*ChannelMap) SetPlayer added in v1.3.0

func (c *ChannelMap) SetPlayer(channel string, p *Player)

func (*ChannelMap) SetPlayerStatus added in v1.3.0

func (c *ChannelMap) SetPlayerStatus(channel, playerName string, status flist.Status)

type CmdLog added in v1.3.0

type CmdLog struct {
	ID      int64
	Command Command
	Args    string
	Player  string
	Channel string
	Created time.Time
}

func (CmdLog) String added in v1.3.0

func (l CmdLog) String() string

type CmdStat added in v1.8.5

type CmdStat struct {
	Command Command
	Uses    int
}

func (CmdStat) String added in v1.8.5

func (s CmdStat) String() string

type Command added in v1.1.1

type Command int
const (
	CmdUnknown Command = iota
	CmdTomato
	CmdTieup
	CmdFeedback
	CmdTktool
	CmdVonprove
	CmdJojo
	CmdLoth
	CmdDadJoke
	CmdTietool
	CmdMuffin
	CmdTicklizer
	CmdAdvice
	CmdAstro
)

func ParseCommand added in v1.3.0

func ParseCommand(s string) (cmd Command, args []string)

func (Command) HasPrefix added in v1.1.1

func (c Command) HasPrefix(s string) bool

func (*Command) Scan added in v1.1.1

func (c *Command) Scan(value interface{}) error

func (Command) String added in v1.1.1

func (c Command) String() string

func (Command) Value added in v1.1.1

func (c Command) Value() (driver.Value, error)

type Feedback

type Feedback struct {
	ID      int64
	Message string
	Player  string
	Created time.Time
}

func (Feedback) String added in v1.3.0

func (f Feedback) String() string

type Image

type Image struct {
	ID        int64
	URL       string
	Done      bool
	Kuid      int
	Created   time.Time
	MessageID int64    `db:"message_id"`
	Message   *Message `db:"message"`
}

func (Image) String added in v1.6.1

func (i Image) String() string

type Loth added in v1.3.0

type Loth struct {
	*Player
	Expires time.Time
}

func NewLoth added in v1.3.0

func NewLoth(p *Player, duration time.Duration) *Loth

func (Loth) Expired added in v1.3.0

func (l Loth) Expired() bool

func (Loth) TimeLeft added in v1.3.0

func (l Loth) TimeLeft() string

type LothLog added in v1.3.0

type LothLog struct {
	ID      int64
	Issuer  string
	Channel string
	Created time.Time
	*Loth
	IsNew   bool `db:"is_new"`
	Targets Targets
}

func (LothLog) String added in v1.3.0

func (l LothLog) String() string

type Message

type Message struct {
	ID      int64
	Message string
	Player  string
	Channel string
	Created time.Time
}

type Player added in v1.3.0

type Player struct {
	Name   string
	Role   flist.Role
	Status flist.Status
	Fave   bool
}

func (Player) String added in v1.3.0

func (p Player) String() string

type PlayerMap added in v1.3.0

type PlayerMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewPlayerMap added in v1.3.0

func NewPlayerMap() *PlayerMap

func (*PlayerMap) DelPlayer added in v1.3.0

func (c *PlayerMap) DelPlayer(playerName string)

func (*PlayerMap) ForEach added in v1.3.0

func (c *PlayerMap) ForEach(fn func(name string, p *Player))

func (*PlayerMap) GetPlayer added in v1.3.0

func (c *PlayerMap) GetPlayer(playerName string) (*Player, bool)

func (*PlayerMap) SetPlayer added in v1.3.0

func (c *PlayerMap) SetPlayer(p *Player)

func (*PlayerMap) SetPlayerFave added in v1.3.1

func (c *PlayerMap) SetPlayerFave(playerName string, fave bool)

func (*PlayerMap) SetPlayerRole added in v1.3.0

func (c *PlayerMap) SetPlayerRole(playerName string, role flist.Role)

func (*PlayerMap) SetPlayerStatus added in v1.3.0

func (c *PlayerMap) SetPlayerStatus(playerName string, status flist.Status)

type Store

type Store interface {
	AddMessageWithURLs(m *Message, urls []string) error
	GetImages(limit, offset int, reverse, filterDone bool) ([]*Image, error)
	ToggleImageDone(id int64) error
	SetImageKuid(id int64, kuid int) error

	AddFeedback(f *Feedback) error
	GetAllFeedback(limit, offset int) ([]*Feedback, error)
	GetRecentFeedback(limit, offset int) ([]*Feedback, error)

	AddCmdLog(e *CmdLog) error
	GetRecentCmdLogs(limit, offset int) ([]*CmdLog, error)
	CmdStats() ([]*CmdStat, error)

	AddLothLog(*LothLog) error
	GetRecentLothLogs(limit, offset int) ([]*LothLog, error)
}

type Targets added in v1.3.0

type Targets []*Player

func (*Targets) Scan added in v1.3.0

func (t *Targets) Scan(value interface{}) error

func (Targets) Value added in v1.3.0

func (t Targets) Value() (driver.Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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