修复:集成聊天图片预览与真实尺寸发送
This commit is contained in:
1 parent
9eb6be2875
commit
ee228381cf
36 files changed
+331
-83
No files matched your search
@@ -413,7 +413,7 @@ func (e *automationActionExecutor) sendImage(ctx context.Context, task Task, ima
|
||||
if !senderOK {
|
||||
return fmt.Errorf("%w: 账号未在线,无法发送自动化图片", ErrMessageNotSent)
|
||||
}
|
||||
return sender.SendImage(ctx, task.ChatID, task.BuyerID, imageURL, cardID)
|
||||
return sender.SendImage(ctx, task.ChatID, task.BuyerID, imageURL, cardID, 0, 0)
|
||||
}
|
||||
|
||||
// cardContent 读取卡密组内容并拒绝不支持的卡密类型。
|
||||
|
||||
@@ -49,7 +49,7 @@ func (s *blockingAutomationSender) SendText(context.Context, string, string, str
|
||||
}
|
||||
|
||||
// SendImage 满足消息发送接口;数据卡测试不会调用图片发送。
|
||||
func (s *blockingAutomationSender) SendImage(context.Context, string, string, string, int64) error {
|
||||
func (s *blockingAutomationSender) SendImage(context.Context, string, string, string, int64, int, int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ type SenderProvider interface {
|
||||
// MessageSender 是自动化动作需要的最小发送接口。
|
||||
type MessageSender interface {
|
||||
SendText(ctx context.Context, chatID, toUserID, text string) error
|
||||
SendImage(ctx context.Context, chatID, toUserID, imageURL string, cardID int64) error
|
||||
SendImage(ctx context.Context, chatID, toUserID, imageURL string, cardID int64, width, height int) error
|
||||
UpdateCookie(cookieStr string)
|
||||
}
|
||||
|
||||
|
||||
@@ -411,7 +411,9 @@ func TestImageCardMissingSenderIsDefinitelyNotSent(t *testing.T) {
|
||||
}
|
||||
|
||||
// SendImage 封装Send图片业务协调。
|
||||
func (s *testSender) SendImage(context.Context, string, string, string, int64) error { return nil }
|
||||
func (s *testSender) SendImage(context.Context, string, string, string, int64, int, int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UpdateCookie 更新登录凭证。
|
||||
func (s *testSender) UpdateCookie(cookieStr string) {
|
||||
|
||||
Reference in new issue
Block a user