18 lines
444 B
Go
18 lines
444 B
Go
package discord
|
|
|
|
import (
|
|
"github.com/sipeed/picoclaw/pkg/bus"
|
|
"github.com/sipeed/picoclaw/pkg/channels"
|
|
"github.com/sipeed/picoclaw/pkg/config"
|
|
"github.com/sipeed/picoclaw/pkg/tts"
|
|
)
|
|
|
|
func init() {
|
|
channels.RegisterFactory("discord", func(cfg *config.Config, b *bus.MessageBus) (channels.Channel, error) {
|
|
ch, err := NewDiscordChannel(cfg.Channels.Discord, b)
|
|
if err == nil {
|
|
ch.tts = tts.DetectTTS(cfg)
|
|
}
|
|
return ch, err
|
|
})
|
|
}
|