diff --git a/pkg/channels/feishu/feishu_64.go b/pkg/channels/feishu/feishu_64.go index 5be698cb5..1b7ce6840 100644 --- a/pkg/channels/feishu/feishu_64.go +++ b/pkg/channels/feishu/feishu_64.go @@ -6,11 +6,6 @@ import ( "context" "encoding/json" "fmt" - lark "github.com/larksuite/oapi-sdk-go/v3" - larkcore "github.com/larksuite/oapi-sdk-go/v3/core" - larkdispatcher "github.com/larksuite/oapi-sdk-go/v3/event/dispatcher" - larkim "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" - larkws "github.com/larksuite/oapi-sdk-go/v3/ws" "io" "math/rand" "net/http" @@ -21,6 +16,12 @@ import ( "sync/atomic" "time" + lark "github.com/larksuite/oapi-sdk-go/v3" + larkcore "github.com/larksuite/oapi-sdk-go/v3/core" + larkdispatcher "github.com/larksuite/oapi-sdk-go/v3/event/dispatcher" + larkim "github.com/larksuite/oapi-sdk-go/v3/service/im/v1" + larkws "github.com/larksuite/oapi-sdk-go/v3/ws" + "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/channels" "github.com/sipeed/picoclaw/pkg/config" diff --git a/pkg/channels/feishu/feishu_64_test.go b/pkg/channels/feishu/feishu_64_test.go index 77c6846ce..9010abf69 100644 --- a/pkg/channels/feishu/feishu_64_test.go +++ b/pkg/channels/feishu/feishu_64_test.go @@ -279,27 +279,3 @@ func TestExtractFeishuSenderID(t *testing.T) { }) } } - -func TestReplyTargetMessageID(t *testing.T) { - strPtr := func(s string) *string { return &s } - - t.Run("prefer parent_id", func(t *testing.T) { - msg := &larkim.EventMessage{ParentId: strPtr("om_parent"), RootId: strPtr("om_root")} - if got := replyTargetID(msg); got != "om_parent" { - t.Fatalf("replyTargetID() = %q, want %q", got, "om_parent") - } - }) - - t.Run("fallback to root_id", func(t *testing.T) { - msg := &larkim.EventMessage{RootId: strPtr("om_root")} - if got := replyTargetID(msg); got != "om_root" { - t.Fatalf("replyTargetID() = %q, want %q", got, "om_root") - } - }) - - t.Run("empty when no fields", func(t *testing.T) { - if got := replyTargetID(&larkim.EventMessage{}); got != "" { - t.Fatalf("replyTargetID() = %q, want empty", got) - } - }) -}