1
0
mirror of https://github.com/fumiama/go-onebot-agent.git synced 2026-06-23 04:30:26 +08:00

feat: mutable cfg & decode base64 img

This commit is contained in:
源文雨
2026-01-17 17:29:58 +08:00
parent f7d2527203
commit f289768c83
3 changed files with 58 additions and 34 deletions

View File

@@ -9,6 +9,14 @@ import (
//go:embed README.md
var sysp string
// Config stores mutable characteristics of the agent.
type Config struct {
ID int64 // ID QQ
Nickname string // Nickname 昵称
Sex string // Sex 性别
Chars string // Chars 个性
}
func (ag *Agent) system(role PermRole, iter int, grp int64) (string, error) {
tab, err := ag.perm.mdtable(role)
if err != nil {
@@ -20,8 +28,8 @@ func (ag *Agent) system(role PermRole, iter int, grp int64) (string, error) {
typ = "私聊"
}
return fmt.Sprintf(
sysp, ag.id, ag.nickname, ag.sex,
ag.chars, tab, ag.memoryof(grp),
sysp, ag.cfg.ID, ag.cfg.Nickname, ag.cfg.Sex,
ag.cfg.Chars, tab, ag.memoryof(grp),
t.Format(time.RFC3339), t.Unix(), typ, iter,
), nil
}