Documentation
¶
Index ¶
- type Connection
- type ConnectionManager
- func (m *ConnectionManager) Close()
- func (m *ConnectionManager) GetConnection(guildID string) (*Connection, bool)
- func (m *ConnectionManager) IsConnected(guildID string) bool
- func (m *ConnectionManager) Join(guildID, channelID string) (*Connection, error)
- func (m *ConnectionManager) Leave(guildID string) error
- type Player
- type Recorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection manages a Discord voice connection
func NewConnection ¶
func NewConnection(voice *discordgo.VoiceConnection) *Connection
NewConnection creates a new voice connection manager from an existing VoiceConnection
func (*Connection) GetChannelID ¶
func (c *Connection) GetChannelID() string
GetChannelID returns the channel ID
func (*Connection) GetGuildID ¶
func (c *Connection) GetGuildID() string
GetGuildID returns the guild ID
func (*Connection) GetVoiceConnection ¶
func (c *Connection) GetVoiceConnection() *discordgo.VoiceConnection
GetVoiceConnection returns the underlying discordgo voice connection
func (*Connection) IsConnected ¶
func (c *Connection) IsConnected() bool
IsConnected returns whether the bot is connected to a voice channel
func (*Connection) Leave ¶
func (c *Connection) Leave() error
Leave disconnects from the voice channel
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
ConnectionManager manages multiple voice connections across guilds
func NewConnectionManager ¶
func NewConnectionManager(session *discordgo.Session) *ConnectionManager
NewConnectionManager creates a new connection manager
func (*ConnectionManager) Close ¶
func (m *ConnectionManager) Close()
Close disconnects from all voice channels
func (*ConnectionManager) GetConnection ¶
func (m *ConnectionManager) GetConnection(guildID string) (*Connection, bool)
GetConnection returns the connection for a guild
func (*ConnectionManager) IsConnected ¶
func (m *ConnectionManager) IsConnected(guildID string) bool
IsConnected checks if connected to a voice channel in a guild
func (*ConnectionManager) Join ¶
func (m *ConnectionManager) Join(guildID, channelID string) (*Connection, error)
Join connects to a voice channel in a guild
func (*ConnectionManager) Leave ¶
func (m *ConnectionManager) Leave(guildID string) error
Leave disconnects from a voice channel in a guild
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player handles audio playback to Discord voice channels using ffmpeg
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
Recorder handles audio recording from Discord voice channels
func NewRecorder ¶
func NewRecorder(conn *Connection) (*Recorder, error)
NewRecorder creates a new audio recorder
func (*Recorder) IsRecording ¶
IsRecording returns whether the recorder is currently recording
func (*Recorder) RecordToFile ¶
RecordToFile starts recording audio to an OGG file