From 8219876bda99f699054eb4d33ebdc8789b96ca9a Mon Sep 17 00:00:00 2001 From: Aimer Neige Date: Sat, 30 Jul 2022 12:58:01 +0800 Subject: [PATCH] fix error --- morning.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/morning.go b/morning.go index 5038838..445fcba 100644 --- a/morning.go +++ b/morning.go @@ -53,6 +53,9 @@ func (m *morning) Serve(b *bot.Bot) { s.Every(1).Day().At("00:00").Do(func() { groupList := b.GroupList for _, group := range groupList { + if isIgnoredGroup(group.Uin) { + continue + } b.SendGroupMessage(group.Code, msg) } }) @@ -76,3 +79,12 @@ func (m *morning) Stop(b *bot.Bot, wg *sync.WaitGroup) { // 别忘了解锁 defer wg.Done() } + +func isIgnoredGroup(id int64) bool { + for _, groupID := range ignoredGroup { + if id == groupID { + return true + } + } + return false +}