Documentation ¶
Index ¶
- Constants
- Variables
- type TtsSession
- func (t *TtsSession) FetchVoiceURL(text, lang string) string
- func (t *TtsSession) GuildID() string
- func (t *TtsSession) IsConnected() bool
- func (t *TtsSession) Join(discord *discordgo.Session, callerUserID, textChannelID string) error
- func (t *TtsSession) Leave(discord *discordgo.Session) error
- func (t *TtsSession) SendMessagef(discord *discordgo.Session, format string, v ...interface{})
- func (t *TtsSession) SetCoefontID(coefontID string)
- func (t *TtsSession) SetLanguage(discord *discordgo.Session, langText string) error
- func (t *TtsSession) SetSpeechSpeed(discord *discordgo.Session, newSpeechSpeed float64) error
- func (t *TtsSession) Speech(discord *discordgo.Session, text string) error
- type TtsSessionManager
Constants ¶
View Source
const DefaultcontentID = "86fe0015-860a-409e-a79e-ff2d5dd818fd"
Variables ¶
View Source
var ErrTtsSessionNotFound = fmt.Errorf("ttsSession not found")
Functions ¶
This section is empty.
Types ¶
type TtsSession ¶
type TtsSession struct { TextChanelID string VoiceConnection *discordgo.VoiceConnection // contains filtered or unexported fields }
TtsSession is a data structure for managing bot agents that participate in one voice channel.
func (*TtsSession) FetchVoiceURL ¶
func (t *TtsSession) FetchVoiceURL(text, lang string) string
func (*TtsSession) IsConnected ¶
func (t *TtsSession) IsConnected() bool
Get state of VoiceConnection.
func (*TtsSession) Join ¶
func (t *TtsSession) Join(discord *discordgo.Session, callerUserID, textChannelID string) error
Join join the same channel as the caller.
func (*TtsSession) Leave ¶
func (t *TtsSession) Leave(discord *discordgo.Session) error
Leave end connection and init variables.
func (*TtsSession) SendMessagef ¶
func (t *TtsSession) SendMessagef(discord *discordgo.Session, format string, v ...interface{})
sendMessagef send text to text chat.
func (*TtsSession) SetLanguage ¶
func (t *TtsSession) SetLanguage(discord *discordgo.Session, langText string) error
SetLanguage.
func (*TtsSession) SetSpeechSpeed ¶
func (t *TtsSession) SetSpeechSpeed(discord *discordgo.Session, newSpeechSpeed float64) error
SetSpeechSpeed validate and set speechSpeed.
type TtsSessionManager ¶
type TtsSessionManager struct {
// contains filtered or unexported fields
}
func NewTtsSessionManager ¶
func NewTtsSessionManager() *TtsSessionManager
NewTtsSession create new TtsSessionManager.
func (*TtsSessionManager) GetByGuildID ¶
func (t *TtsSessionManager) GetByGuildID(guildID string) (*TtsSession, error)
GetByGuildID.
Click to show internal directories.
Click to hide internal directories.