fix package

This commit is contained in:
lpf
2026-02-12 11:18:43 +08:00
parent 4956b1a014
commit cad0a4de5b
23 changed files with 1364 additions and 90 deletions

View File

@@ -4,7 +4,7 @@ import (
"context"
"fmt"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"clawgo/pkg/bus"
)
type Channel interface {

View File

@@ -9,22 +9,22 @@ import (
"log"
"sync"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"github.com/open-dingtalk/dingtalk-stream-sdk-go/chatbot"
"github.com/open-dingtalk/dingtalk-stream-sdk-go/client"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
)
// DingTalkChannel implements the Channel interface for DingTalk (钉钉)
// It uses WebSocket for receiving messages via stream mode and API for sending
type DingTalkChannel struct {
*BaseChannel
config config.DingTalkConfig
clientID string
clientSecret string
streamClient *client.StreamClient
ctx context.Context
cancel context.CancelFunc
config config.DingTalkConfig
clientID string
clientSecret string
streamClient *client.StreamClient
ctx context.Context
cancel context.CancelFunc
// Map to store session webhooks for each chat
sessionWebhooks sync.Map // chatID -> sessionWebhook
}

View File

@@ -11,11 +11,11 @@ import (
"strings"
"time"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"clawgo/pkg/logger"
"clawgo/pkg/voice"
"github.com/bwmarrin/discordgo"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"gitea.kkkk.dev/DBT/clawgo/pkg/logger"
"gitea.kkkk.dev/DBT/clawgo/pkg/voice"
)
type DiscordChannel struct {

View File

@@ -12,9 +12,9 @@ import (
larkim "github.com/larksuite/oapi-sdk-go/v3/service/im/v1"
larkws "github.com/larksuite/oapi-sdk-go/v3/ws"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"gitea.kkkk.dev/DBT/clawgo/pkg/logger"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"clawgo/pkg/logger"
)
type FeishuChannel struct {

View File

@@ -7,9 +7,9 @@ import (
"net"
"sync"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"gitea.kkkk.dev/DBT/clawgo/pkg/logger"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"clawgo/pkg/logger"
)
type MaixCamChannel struct {

View File

@@ -11,9 +11,9 @@ import (
"fmt"
"sync"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"gitea.kkkk.dev/DBT/clawgo/pkg/logger"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"clawgo/pkg/logger"
)
type Manager struct {

View File

@@ -13,9 +13,9 @@ import (
"github.com/tencent-connect/botgo/token"
"golang.org/x/oauth2"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"gitea.kkkk.dev/DBT/clawgo/pkg/logger"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"clawgo/pkg/logger"
)
type QQChannel struct {

View File

@@ -16,9 +16,9 @@ import (
"github.com/mymmrac/telego"
"github.com/mymmrac/telego/telegoutil"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"gitea.kkkk.dev/DBT/clawgo/pkg/voice"
"clawgo/pkg/bus"
"clawgo/pkg/config"
"clawgo/pkg/voice"
)
type TelegramChannel struct {
@@ -125,14 +125,14 @@ func (c *TelegramChannel) Send(ctx context.Context, msg bus.OutboundMessage) err
// Try to edit placeholder
if pID, ok := c.placeholders.Load(msg.ChatID); ok {
c.placeholders.Delete(msg.ChatID)
_, err := c.bot.EditMessageText(ctx, &telego.EditMessageTextParams{
ChatID: chatID,
MessageID: pID.(int),
Text: htmlContent,
ParseMode: telego.ModeHTML,
})
if err == nil {
return nil
}

View File

@@ -10,8 +10,8 @@ import (
"github.com/gorilla/websocket"
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
"gitea.kkkk.dev/DBT/clawgo/pkg/config"
"clawgo/pkg/bus"
"clawgo/pkg/config"
)
type WhatsAppChannel struct {