lsp

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: AGPL-3.0 Imports: 44 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      = "倒放"
	ImageContentCommand = "ic"
	HelpCommand         = "help"
	ConfigCommand       = "config"
)
View Source
const (
	PingCommand    = "ping"
	LogCommand     = "log"
	BlockCommand   = "block"
	SysinfoCommand = "sysinfo"
)

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

func IConfigAtAllCmd added in v0.0.10

func IConfigAtAllCmd(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, on bool)

func IConfigAtCmd added in v0.0.13

func IConfigAtCmd(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, action string, QQ []int64)

func IConfigFilterCmdClear added in v0.0.14

func IConfigFilterCmdClear(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type)

func IConfigFilterCmdNotType added in v0.0.14

func IConfigFilterCmdNotType(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, types []string)

func IConfigFilterCmdShow added in v0.0.14

func IConfigFilterCmdShow(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type)

func IConfigFilterCmdText added in v0.0.14

func IConfigFilterCmdText(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, keywords []string)

func IConfigFilterCmdType added in v0.0.14

func IConfigFilterCmdType(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, types []string)

func IConfigOfflineNotifyCmd added in v0.0.13

func IConfigOfflineNotifyCmd(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, on bool)

func IConfigTitleNotifyCmd added in v0.0.13

func IConfigTitleNotifyCmd(c *MessageContext, groupCode int64, id string, site string, ctype concern.Type, on bool)

func IEnable added in v0.0.7

func IEnable(c *MessageContext, groupCode int64, command string, disable bool)

func IGrantCmd added in v0.0.9

func IGrantCmd(c *MessageContext, groupCode int64, command string, grantTo int64, del bool)

func IGrantRole added in v0.0.9

func IGrantRole(c *MessageContext, groupCode int64, grantRole permission.RoleType, grantTo int64, del bool)

func IList added in v0.0.8

func IList(c *MessageContext, groupCode int64)

func IWatch added in v0.0.7

func IWatch(c *MessageContext, groupCode int64, id string, site string, watchType concern.Type, remove bool)

func ReplyUserInfo added in v0.0.13

func ReplyUserInfo(c *MessageContext, site string, id string)

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(inotify concern.Notify) *message.SendingMessage

func (*Lsp) PostInit

func (l *Lsp) PostInit()

func (*Lsp) PostStart added in v0.0.6

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

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) ConfigCommand added in v0.0.10

func (lgc *LspGroupCommand) ConfigCommand()

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) NewMessageContext added in v0.0.10

func (lgc *LspGroupCommand) NewMessageContext(log *logrus.Entry) *MessageContext

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) ConfigCommand added in v0.0.10

func (c *LspPrivateCommand) ConfigCommand()

func (*LspPrivateCommand) DebugCheck

func (c *LspPrivateCommand) DebugCheck() bool

func (*LspPrivateCommand) DefaultLogger

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

func (*LspPrivateCommand) DefaultLoggerWithCommand added in v0.0.7

func (c *LspPrivateCommand) DefaultLoggerWithCommand(command string) *logrus.Entry

func (*LspPrivateCommand) EnableCommand added in v0.0.7

func (c *LspPrivateCommand) EnableCommand(disable bool)

func (*LspPrivateCommand) Execute

func (c *LspPrivateCommand) Execute()

func (*LspPrivateCommand) GrantCommand added in v0.0.9

func (c *LspPrivateCommand) GrantCommand()

func (*LspPrivateCommand) HelpCommand

func (c *LspPrivateCommand) HelpCommand()

func (*LspPrivateCommand) ListCommand added in v0.0.8

func (c *LspPrivateCommand) ListCommand()

func (*LspPrivateCommand) LogCommand

func (c *LspPrivateCommand) LogCommand()

func (*LspPrivateCommand) NewMessageContext added in v0.0.9

func (c *LspPrivateCommand) NewMessageContext(log *logrus.Entry) *MessageContext

func (*LspPrivateCommand) PingCommand

func (c *LspPrivateCommand) PingCommand()

func (*LspPrivateCommand) SysinfoCommand added in v0.0.8

func (c *LspPrivateCommand) SysinfoCommand()

func (*LspPrivateCommand) WatchCommand added in v0.0.7

func (c *LspPrivateCommand) WatchCommand(remove bool)

type MessageContext added in v0.0.9

type MessageContext struct {
	TextReply         func(text string) interface{}
	Reply             func(sendingMessage *message.SendingMessage) interface{}
	Send              func(sendingMessage *message.SendingMessage) interface{}
	NoPermissionReply func() interface{}
	DisabledReply     func() interface{}
	Lsp               *Lsp
	Log               *logrus.Entry
	Sender            *message.Sender
	Source            SourceType
}

func NewMessageContext added in v0.0.9

func NewMessageContext() *MessageContext

func (*MessageContext) IsFromGroup added in v0.0.13

func (c *MessageContext) IsFromGroup() bool

func (*MessageContext) IsFromPrivate added in v0.0.13

func (c *MessageContext) IsFromPrivate() bool

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)

func (*Runtime) ParseRawSite added in v0.0.7

func (r *Runtime) ParseRawSite(rawSite string) (string, error)

func (*Runtime) ParseRawSiteAndType added in v0.0.7

func (r *Runtime) ParseRawSiteAndType(rawSite string, rawType string) (string, concern.Type, error)

type SourceType added in v0.0.13

type SourceType int
const (
	SourceTypeGroup SourceType = iota
	SourceTypePrivate
)

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