session

package
v0.0.0-...-4f1cae0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 NewTtsSession

func NewTtsSession() *TtsSession

NewTtsSession create new TtsSession.

func (*TtsSession) FetchVoiceURL

func (t *TtsSession) FetchVoiceURL(text, lang string) string

func (*TtsSession) GuildID

func (t *TtsSession) GuildID() string

GetByGuildID.

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) SetCoefontID

func (t *TtsSession) SetCoefontID(coefontID string)

SetCoefontID.

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.

func (*TtsSession) Speech

func (t *TtsSession) Speech(discord *discordgo.Session, text string) error

Speech speech the received text on the voice channel.

type TtsSessionManager

type TtsSessionManager struct {
	// contains filtered or unexported fields
}

func NewTtsSessionManager

func NewTtsSessionManager() *TtsSessionManager

NewTtsSession create new TtsSessionManager.

func (*TtsSessionManager) Add

func (t *TtsSessionManager) Add(ttsSession *TtsSession) error

Add.

func (*TtsSessionManager) GetByGuildID

func (t *TtsSessionManager) GetByGuildID(guildID string) (*TtsSession, error)

GetByGuildID.

func (*TtsSessionManager) Remove

func (t *TtsSessionManager) Remove(guildID string) error

Remove.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL