first commit

This commit is contained in:
cdle
2023-06-01 08:41:54 +08:00
parent 61b0e99833
commit d253ed8d5b
80 changed files with 14245 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
package common
type Function struct {
Rules []string `json:"-"`
Params [][]string `json:"-"`
ImType *Filter `json:"-"`
UserId *Filter `json:"-"`
GroupId *Filter `json:"-"`
FindAll bool `json:"-"`
Admin bool `json:"-"`
Handle func(s Sender) interface{} `json:"-"`
Cron string `json:"cron"`
Priority int `json:"-"`
Disable bool `json:"-"`
Hidden bool `json:"-"`
CronId int `json:"-"`
Origin string `json:"-"`
UUID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Public bool `json:"public"`
Icon string `json:"icon"`
Version string `json:"version"`
Author string `json:"author"`
Status int `json:"status"` //0未安装 1可更新 2已安装
Address string `json:"-"`
CreateAt string `json:"create_at"`
Module bool `json:"module"`
// Web bool `json:"web"`
Encrypt bool `json:"encrypt"`
OnStart bool `json:"on_start"`
PluginPublisher
Running bool `json:"-"`
}
type Filter struct {
BlackMode bool
Items []string
}
type PluginPublisher struct {
Address string `json:"address"`
Organization string `json:"organization"`
Identified bool `json:"identified"`
}
+55
View File
@@ -0,0 +1,55 @@
package common
type Sender interface {
GetUserID() string
GetChatID() string
GetBotID() string
GetImType() string
GetMessageID() string
RecallMessage(...interface{}) error
GetUserName() string
GetChatName() string
IsReply() bool
GetReplyUserID() int
GetReplyMessageID() int
GetRawMessage() interface{}
SetMatch([]string)
SetParams([]string)
SetAllMatch([][]string)
GetMatch() []string
GetAllMatch() [][]string
Get(interface{}) string
GetContent() string
SetContent(string)
SetFsps(fsps *FakerSenderParams)
IsAdmin() bool
IsMedia() bool
Reply(...interface{}) (string, error)
Push(map[string]string) (string, error)
Delete() error
Finish()
Continue()
IsContinue() bool
ClearContinue()
Await(Sender, func(Sender) interface{}, ...interface{}) interface{}
Copy() Sender
GroupKick(uid string, reject_add_request bool)
GroupUnkick(uid string)
GroupBan(uid string, duration int)
GroupUnban(uid string)
AtLast()
UAtLast()
IsAtLast() bool
MessagesToSend() string
Stop()
SetMark(interface{})
GetMark() interface{}
SetLevel(int)
GetLevel() int
}
type FakerSenderParams struct {
Content string
UserID string
ChatID string
}