This commit is contained in:
cdle
2021-09-18 08:44:34 +08:00
parent b1dc4cde77
commit 7c5aedfd24
2 changed files with 5 additions and 9 deletions
+2 -1
View File
@@ -41,7 +41,8 @@ func initSys() {
{ {
Rules: []string{"raw ^重启$"}, Rules: []string{"raw ^重启$"},
Admin: true, Admin: true,
Handle: func(_ im.Sender) interface{} { Handle: func(s im.Sender) interface{} {
s.Disappear()
Daemon() Daemon()
return nil return nil
}, },
+3 -8
View File
@@ -181,14 +181,9 @@ func (sender *Sender) Reply(msgs ...interface{}) error {
if id > 0 && sender.Duration != nil { if id > 0 && sender.Duration != nil {
go func() { go func() {
time.Sleep(*sender.Duration) time.Sleep(*sender.Duration)
for i := 1; i < 5; i++ { sender.Delete()
sender.Delete() MSG := bot.GetMessage(id)
MSG := bot.GetMessage(id) bot.Client.RecallGroupMessage(m.GroupCode, MSG["message-id"].(int32), MSG["internal-id"].(int32))
if bot.Client.RecallGroupMessage(m.GroupCode, MSG["message-id"].(int32), MSG["internal-id"].(int32)) == nil {
break
}
time.Sleep(time.Second)
}
}() }()
} }
} }