mirror of
https://github.com/fumiama/go-onebot-agent.git
synced 2026-06-11 21:50:25 +08:00
chore: make lint happy
This commit is contained in:
@@ -12,6 +12,7 @@ var (
|
||||
errMemoryHasReturn = errors.New("memory has \\r|\\n")
|
||||
)
|
||||
|
||||
// MemoryStorage can be a db or just some files
|
||||
type MemoryStorage interface {
|
||||
Save(grp int64, text string) error
|
||||
Load(grp int64) []string
|
||||
|
||||
16
types.go
16
types.go
@@ -64,19 +64,3 @@ type Terminus struct{}
|
||||
func (Terminus) String() string {
|
||||
return `{"action":"` + EOA + `"}`
|
||||
}
|
||||
|
||||
type Memory struct {
|
||||
Action string `json:"action"`
|
||||
GroupID int64 `json:"group_id,omitempty"` // QQ群号
|
||||
UserID int64 `json:"user_id,omitempty"` // QQ号
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
func (m *Memory) String() string {
|
||||
sb := strings.Builder{}
|
||||
err := json.NewEncoder(&sb).Encode(m)
|
||||
if err != nil {
|
||||
panic(errors.Wrap(err, "unexpected"))
|
||||
}
|
||||
return strings.TrimSpace(sb.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user