picoclaw/pkg/channels/matrix/init.go

21 lines
549 B
Go
Raw Normal View History

2026-03-07 17:44:24 +00:00
package matrix
import (
"path/filepath"
2026-03-07 17:44:24 +00:00
"github.com/sipeed/picoclaw/pkg/bus"
"github.com/sipeed/picoclaw/pkg/channels"
"github.com/sipeed/picoclaw/pkg/config"
)
func init() {
channels.RegisterFactory("matrix", func(cfg *config.Config, b *bus.MessageBus) (channels.Channel, error) {
matrixCfg := cfg.Channels.Matrix
cryptoDatabasePath := matrixCfg.CryptoDatabasePath
if cryptoDatabasePath == "" {
cryptoDatabasePath = filepath.Join(cfg.WorkspacePath(), "matrix")
}
return NewMatrixChannel(matrixCfg, b, cryptoDatabasePath)
2026-03-07 17:44:24 +00:00
})
}