lsp

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RollCommand         = "roll"
	CheckinCommand      = "签到"
	GrantCommand        = "grant"
	LspCommand          = "lsp"
	WatchCommand        = "watch"
	UnwatchCommand      = "unwatch"
	ListCommand         = "list"
	SetuCommand         = "色图"
	HuangtuCommand      = "黄图"
	EnableCommand       = "enable"
	DisableCommand      = "disable"
	FaceCommand         = "face"
	ReverseCommand      = "reverse"
	ImageContentCommand = "ic"
	HelpCommand         = "help"
)
View Source
const (
	PingCommand  = "ping"
	LogCommand   = "log"
	BlockCommand = "block"
)

private command

View Source
const ModuleName = "me.sora233.Lsp"

Variables

View Source
var Debug = false

Functions

func CheckOperateableCommand

func CheckOperateableCommand(command string) bool

func CheckValidCommand

func CheckValidCommand(command string) bool

Types

type KeySet

type KeySet struct{}

func (KeySet) GroupMessageImageKey

func (KeySet) GroupMessageImageKey(keys ...interface{}) string

func (KeySet) GroupMuteKey

func (KeySet) GroupMuteKey(keys ...interface{}) string

type Lsp

type Lsp struct {
	PermissionStateManager *permission.StateManager
	LspStateManager        *StateManager
	// contains filtered or unexported fields
}
var Instance *Lsp

func (*Lsp) ConcernNotify

func (l *Lsp) ConcernNotify(bot *bot.Bot)

func (*Lsp) FreshIndex

func (l *Lsp) FreshIndex()

func (*Lsp) GetImageFromPool

func (l *Lsp) GetImageFromPool(options ...image_pool.OptionFunc) ([]image_pool.Image, error)

func (*Lsp) Init

func (l *Lsp) Init()

func (*Lsp) MiraiGoModule

func (l *Lsp) MiraiGoModule() bot.ModuleInfo

func (*Lsp) NotifyMessage

func (l *Lsp) NotifyMessage(bot *bot.Bot, inotify concern.Notify) []message.IMessageElement

func (*Lsp) PostInit

func (l *Lsp) PostInit()

func (*Lsp) RemoveAllByGroup

func (l *Lsp) RemoveAllByGroup(groupCode int64)

func (*Lsp) Serve

func (l *Lsp) Serve(bot *bot.Bot)

func (*Lsp) Start

func (l *Lsp) Start(bot *bot.Bot)

func (*Lsp) Stop

func (l *Lsp) Stop(bot *bot.Bot, wg *sync.WaitGroup)

type LspGroupCommand

type LspGroupCommand struct {
	*Runtime
	// contains filtered or unexported fields
}

func NewLspGroupCommand

func NewLspGroupCommand(bot *miraiBot.Bot, l *Lsp, msg *message.GroupMessage) *LspGroupCommand

func (*LspGroupCommand) CheckinCommand

func (lgc *LspGroupCommand) CheckinCommand()

func (*LspGroupCommand) DebugCheck

func (lgc *LspGroupCommand) DebugCheck() bool

func (*LspGroupCommand) DefaultLogger

func (lgc *LspGroupCommand) DefaultLogger() *logrus.Entry

func (*LspGroupCommand) DefaultLoggerWithCommand

func (lgc *LspGroupCommand) DefaultLoggerWithCommand(command string) *logrus.Entry

func (*LspGroupCommand) EnableCommand

func (lgc *LspGroupCommand) EnableCommand(disable bool)

func (*LspGroupCommand) Execute

func (lgc *LspGroupCommand) Execute()

func (*LspGroupCommand) FaceCommand

func (lgc *LspGroupCommand) FaceCommand()

func (*LspGroupCommand) GrantCommand

func (lgc *LspGroupCommand) GrantCommand()

func (*LspGroupCommand) HelpCommand

func (lgc *LspGroupCommand) HelpCommand()

func (*LspGroupCommand) ImageContent

func (lgc *LspGroupCommand) ImageContent()

func (*LspGroupCommand) ListCommand

func (lgc *LspGroupCommand) ListCommand()

func (*LspGroupCommand) LspCommand

func (lgc *LspGroupCommand) LspCommand()

func (*LspGroupCommand) ReverseCommand

func (lgc *LspGroupCommand) ReverseCommand()

func (*LspGroupCommand) RollCommand

func (lgc *LspGroupCommand) RollCommand()

func (*LspGroupCommand) SetuCommand

func (lgc *LspGroupCommand) SetuCommand(r18 bool)

func (*LspGroupCommand) WatchCommand

func (lgc *LspGroupCommand) WatchCommand(remove bool)

type LspPrivateCommand

type LspPrivateCommand struct {
	*Runtime
	// contains filtered or unexported fields
}

func NewLspPrivateCommand

func NewLspPrivateCommand(bot *miraiBot.Bot, l *Lsp, msg *message.PrivateMessage) *LspPrivateCommand

func (*LspPrivateCommand) BlockCommand

func (c *LspPrivateCommand) BlockCommand()

func (*LspPrivateCommand) DebugCheck

func (c *LspPrivateCommand) DebugCheck() bool

func (*LspPrivateCommand) DefaultLogger

func (c *LspPrivateCommand) DefaultLogger() *logrus.Entry

func (*LspPrivateCommand) Execute

func (c *LspPrivateCommand) Execute()

func (*LspPrivateCommand) HelpCommand

func (c *LspPrivateCommand) HelpCommand()

func (*LspPrivateCommand) LogCommand

func (c *LspPrivateCommand) LogCommand()

func (*LspPrivateCommand) PingCommand

func (c *LspPrivateCommand) PingCommand()

type Runtime

type Runtime struct {
	*command.Parser
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(bot *miraiBot.Bot, l *Lsp) *Runtime

func (*Runtime) Debug

func (r *Runtime) Debug()

func (*Runtime) Exit

func (r *Runtime) Exit(int)

type StateManager

type StateManager struct {
	*localdb.ShortCut
	KeySet
}

func NewStateManager

func NewStateManager() *StateManager

func (*StateManager) FreshIndex

func (s *StateManager) FreshIndex()

func (*StateManager) GetGroupInvitor

func (s *StateManager) GetGroupInvitor(groupCode int64) (target int64, err error)

func (*StateManager) GetMessageImageUrl

func (s *StateManager) GetMessageImageUrl(groupCode int64, messageID int32) []string

func (*StateManager) IsMuted

func (s *StateManager) IsMuted(groupCode int64, uin int64) bool

func (*StateManager) Muted

func (s *StateManager) Muted(groupCode int64, uin int64, t int32) error

func (*StateManager) SaveGroupInvitor

func (s *StateManager) SaveGroupInvitor(groupCode int64, uin int64) error

func (*StateManager) SaveMessageImageUrl

func (s *StateManager) SaveMessageImageUrl(groupCode int64, messageID int32, msgs []message.IMessageElement) error

type Status

type Status struct {
	ImagePoolEnable bool
	ProxyPoolEnable bool
	AliyunEnable    bool
}

func NewStatus

func NewStatus() *Status

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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