mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-18 07:07:32 +08:00
fix package
This commit is contained in:
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"gitea.kkkk.dev/DBT/clawgo/pkg/bus"
|
||||
"clawgo/pkg/bus"
|
||||
)
|
||||
|
||||
type Channel interface {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user