mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
fix: send temp message
This commit is contained in:
parent
daec9cf12c
commit
cebf9c25e1
@ -299,7 +299,7 @@ func (bot *CQBot) SendPrivateMessage(target int64, groupID int64, m *message.Sen
|
|||||||
}
|
}
|
||||||
} else if code, ok := bot.tempMsgCache.Load(target); ok || groupID != 0 { // 临时会话
|
} else if code, ok := bot.tempMsgCache.Load(target); ok || groupID != 0 { // 临时会话
|
||||||
switch {
|
switch {
|
||||||
case bot.Client.FindGroup(groupID) == nil:
|
case groupID != 0 && bot.Client.FindGroup(groupID) == nil:
|
||||||
log.Errorf("错误: 找不到群(%v)", groupID)
|
log.Errorf("错误: 找不到群(%v)", groupID)
|
||||||
id = -1
|
id = -1
|
||||||
case groupID != 0 && !bot.Client.FindGroup(groupID).AdministratorOrOwner():
|
case groupID != 0 && !bot.Client.FindGroup(groupID).AdministratorOrOwner():
|
||||||
@ -309,7 +309,7 @@ func (bot *CQBot) SendPrivateMessage(target int64, groupID int64, m *message.Sen
|
|||||||
log.Errorf("错误: 群员(%v) 不在 群(%v), 无法发起临时会话", target, groupID)
|
log.Errorf("错误: 群员(%v) 不在 群(%v), 无法发起临时会话", target, groupID)
|
||||||
id = -1
|
id = -1
|
||||||
default:
|
default:
|
||||||
if code != nil {
|
if code != nil && groupID == 0 {
|
||||||
groupID = code.(int64)
|
groupID = code.(int64)
|
||||||
}
|
}
|
||||||
msg := bot.Client.SendTempMessage(groupID, target, m)
|
msg := bot.Client.SendTempMessage(groupID, target, m)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user