Skip to content

Commit

Permalink
fix(cqbot): Wrong unsent notification to some group
Browse files Browse the repository at this point in the history
Signed-off-by: fzxiao233 <fzxiao@outlook.com>
  • Loading branch information
AlotOfBlahaj committed Oct 25, 2020
1 parent 4dbd6fe commit 5684cc1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions live/plugins/cqBot.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ func (p *PluginCQBot) LiveStart(process *videoworker.ProcessVideo) error {

msg := CreateLiveMsg(video)
c := &CQMsg{Message: msg}
cc := &CQConfig{
CQHost: config.CQHost,
CQToken: config.CQToken,
}
//cc := &CQConfig{
// CQHost: config.CQHost,
// CQToken: config.CQToken,
//}
for _, GroupId := range config.QQGroupID {
sentGroupIds := p.sentMsg[msg]
_, ok = sentGroupIds[GroupId]
Expand All @@ -82,8 +82,11 @@ func (p *PluginCQBot) LiveStart(process *videoworker.ProcessVideo) error {
continue
}
c.GroupId = GroupId
cc.sendGroupMsg(c)
//cc.sendGroupMsg(c)
log.Infof("%s|%s send notice to %d", video.Provider, video.UsersConfig.Name, GroupId)
if sentGroupIds == nil {
p.sentMsg[msg] = make(map[int]int)
}
p.sentMsg[msg][GroupId] = 1
}
return nil
Expand Down

0 comments on commit 5684cc1

Please sign in to comment.