Documentation ¶
Index ¶
- Constants
- Variables
- type CPU
- type ChannelMix
- type Distortion
- type Duration
- func (d Duration) Days() int64
- func (d Duration) Hours() int64
- func (d Duration) HoursPart() int64
- func (d Duration) Milliseconds() int64
- func (d Duration) MillisecondsPart() int64
- func (d Duration) Minutes() int64
- func (d Duration) MinutesPart() int64
- func (d Duration) Seconds() int64
- func (d Duration) SecondsPart() int64
- func (d Duration) String() string
- type EqBand
- type Equalizer
- type Error
- type Event
- type EventType
- type Exception
- type Filters
- type FrameStats
- type Git
- type Info
- type Karaoke
- type LoadResult
- type LoadType
- type LowPass
- type Memory
- type Message
- type Op
- type Player
- type PlayerPauseEvent
- type PlayerResumeEvent
- type PlayerState
- type PlayerUpdate
- type PlayerUpdateMessage
- type PlayerUpdateOpt
- func WithEncodedTrack(encodedTrack string) PlayerUpdateOpt
- func WithEndTime(endTime Duration) PlayerUpdateOpt
- func WithFilters(filters Filters) PlayerUpdateOpt
- func WithIdentifier(identifier string) PlayerUpdateOpt
- func WithNoReplace(noReplace bool) PlayerUpdateOpt
- func WithNullTrack() PlayerUpdateOpt
- func WithPaused(paused bool) PlayerUpdateOpt
- func WithPosition(position Duration) PlayerUpdateOpt
- func WithTrack(track Track) PlayerUpdateOpt
- func WithVoice(voice VoiceState) PlayerUpdateOpt
- func WithVolume(volume int) PlayerUpdateOpt
- type Players
- type Playlist
- type PlaylistInfo
- type Plugin
- type Plugins
- type ReadyMessage
- type Rotation
- type SearchType
- type Session
- type SessionUpdate
- type Severity
- type Stats
- type StatsMessage
- type Timescale
- type Timestamp
- type Track
- type TrackEndEvent
- type TrackEndReason
- type TrackExceptionEvent
- type TrackInfo
- type TrackStartEvent
- type TrackStuckEvent
- type Tremolo
- type UnknownEvent
- type UnknownMessage
- type Version
- type Vibrato
- type VoiceState
- type Volume
- type WebSocketClosedEvent
Constants ¶
View Source
const ( Millisecond Duration = 1 Second = 1000 * Millisecond Minute = 60 * Second Hour = 60 * Minute Day = 24 * Hour )
Variables ¶
View Source
var DefaultFilters = []string{"volume", "equalizer", "timescale", "tremolo", "vibrato", "rotation", "karaoke", "distortion", "channelMix", "lowPass"}
Functions ¶
This section is empty.
Types ¶
type ChannelMix ¶
type Distortion ¶
type Distortion struct { SinOffset float32 `json:"sinOffset"` SinScale float32 `json:"sinScale"` CosOffset float32 `json:"cosOffset"` CosScale float32 `json:"cosScale"` TanOffset float32 `json:"tanOffset"` TanScale float32 `json:"tanScale"` Offset float32 `json:"offset"` Scale float32 `json:"scale"` }
type Duration ¶
type Duration int64
func (Duration) Milliseconds ¶
func (Duration) MillisecondsPart ¶
func (Duration) MinutesPart ¶
func (Duration) SecondsPart ¶
type Equalizer ¶
type Equalizer [15]float32
func (Equalizer) MarshalJSON ¶
MarshalJSON marshals the map as object array
func (*Equalizer) UnmarshalJSON ¶
type Error ¶
type EventType ¶
type EventType string
const ( EventTypeTrackStart EventType = "TrackStartEvent" EventTypeTrackEnd EventType = "TrackEndEvent" EventTypeTrackException EventType = "TrackExceptionEvent" EventTypeTrackStuck EventType = "TrackStuckEvent" EventTypeWebSocketClosed EventType = "WebSocketClosedEvent" EventTypePlayerPause EventType = "PlayerPauseEvent" // not actually sent by lavalink EventTypePlayerResume EventType = "PlayerResumeEvent" // not actually sent by lavalink )
type Exception ¶
type Filters ¶
type Filters struct { Volume *Volume `json:"volume,omitempty"` Equalizer *Equalizer `json:"equalizer,omitempty"` Timescale *Timescale `json:"timescale,omitempty"` Tremolo *Tremolo `json:"tremolo,omitempty"` Vibrato *Vibrato `json:"vibrato,omitempty"` Rotation *Rotation `json:"rotation,omitempty"` Karaoke *Karaoke `json:"karaoke,omitempty"` Distortion *Distortion `json:"distortion,omitempty"` ChannelMix *ChannelMix `json:"channelMix,omitempty"` LowPass *LowPass `json:"lowPass,omitempty"` PluginFilters map[string]any `json:"-"` }
func (Filters) MarshalJSON ¶
func (*Filters) UnmarshalJSON ¶
type FrameStats ¶
type LoadResult ¶
type LoadResult struct { LoadType LoadType `json:"loadType"` PlaylistInfo PlaylistInfo `json:"playlistInfo"` Tracks []Track `json:"tracks"` Exception Exception `json:"exception"` }
type Player ¶
type Player struct { GuildID snowflake.ID `json:"guildId"` Track *Track `json:"track"` Volume int `json:"volume"` Paused bool `json:"paused"` Voice VoiceState `json:"voice"` Filters Filters `json:"filters"` }
type PlayerPauseEvent ¶
type PlayerPauseEvent struct {
GuildID_ snowflake.ID `json:"guildId"`
}
func (PlayerPauseEvent) GuildID ¶
func (e PlayerPauseEvent) GuildID() snowflake.ID
func (PlayerPauseEvent) Op ¶
func (PlayerPauseEvent) Op() Op
func (PlayerPauseEvent) Type ¶
func (PlayerPauseEvent) Type() EventType
type PlayerResumeEvent ¶
type PlayerResumeEvent struct {
GuildID_ snowflake.ID `json:"guildId"`
}
func (PlayerResumeEvent) GuildID ¶
func (e PlayerResumeEvent) GuildID() snowflake.ID
func (PlayerResumeEvent) Op ¶
func (PlayerResumeEvent) Op() Op
func (PlayerResumeEvent) Type ¶
func (PlayerResumeEvent) Type() EventType
type PlayerState ¶
type PlayerUpdate ¶
type PlayerUpdate struct { EncodedTrack *json.Nullable[string] `json:"encodedTrack,omitempty"` Identifier *string `json:"identifier,omitempty"` Position *Duration `json:"position,omitempty"` EndTime *Duration `json:"endTime,omitempty"` Volume *int `json:"volume,omitempty"` Paused *bool `json:"paused,omitempty"` Voice *VoiceState `json:"voice,omitempty"` Filters *Filters `json:"filters,omitempty"` NoReplace bool `json:"-"` }
func DefaultPlayerUpdate ¶
func DefaultPlayerUpdate() *PlayerUpdate
func (*PlayerUpdate) Apply ¶
func (u *PlayerUpdate) Apply(opts []PlayerUpdateOpt)
type PlayerUpdateMessage ¶
type PlayerUpdateMessage struct { State PlayerState `json:"state"` GuildID snowflake.ID `json:"guildId"` }
func (PlayerUpdateMessage) Op ¶
func (PlayerUpdateMessage) Op() Op
type PlayerUpdateOpt ¶
type PlayerUpdateOpt func(update *PlayerUpdate)
func WithEncodedTrack ¶
func WithEncodedTrack(encodedTrack string) PlayerUpdateOpt
func WithEndTime ¶
func WithEndTime(endTime Duration) PlayerUpdateOpt
func WithFilters ¶
func WithFilters(filters Filters) PlayerUpdateOpt
func WithIdentifier ¶
func WithIdentifier(identifier string) PlayerUpdateOpt
func WithNoReplace ¶
func WithNoReplace(noReplace bool) PlayerUpdateOpt
func WithNullTrack ¶
func WithNullTrack() PlayerUpdateOpt
func WithPaused ¶
func WithPaused(paused bool) PlayerUpdateOpt
func WithPosition ¶
func WithPosition(position Duration) PlayerUpdateOpt
func WithTrack ¶
func WithTrack(track Track) PlayerUpdateOpt
func WithVoice ¶
func WithVoice(voice VoiceState) PlayerUpdateOpt
func WithVolume ¶
func WithVolume(volume int) PlayerUpdateOpt
type Playlist ¶
type Playlist struct { Info PlaylistInfo `json:"info"` Tracks []Track `json:"tracks"` }
type PlaylistInfo ¶
type ReadyMessage ¶
func (ReadyMessage) Op ¶
func (ReadyMessage) Op() Op
type SearchType ¶
type SearchType string
const ( SearchTypeYoutube SearchType = "ytsearch" SearchTypeYoutubeMusic SearchType = "ytmsearch" SearchTypeSoundCloud SearchType = "scsearch" )
search prefixes
func (SearchType) Apply ¶
func (t SearchType) Apply(searchString string) string
type SessionUpdate ¶
type Stats ¶
type TrackEndEvent ¶
type TrackEndEvent struct { EncodedTrack string `json:"encodedTrack"` Reason TrackEndReason `json:"reason"` GuildID_ snowflake.ID `json:"guildId"` }
func (TrackEndEvent) GuildID ¶
func (e TrackEndEvent) GuildID() snowflake.ID
func (TrackEndEvent) Op ¶
func (TrackEndEvent) Op() Op
func (TrackEndEvent) Type ¶
func (TrackEndEvent) Type() EventType
type TrackEndReason ¶
type TrackEndReason string
const ( TrackEndReasonFinished TrackEndReason = "FINISHED" TrackEndReasonLoadFailed TrackEndReason = "LOAD_FAILED" TrackEndReasonStopped TrackEndReason = "STOPPED" TrackEndReasonReplaced TrackEndReason = "REPLACED" TrackEndReasonCleanup TrackEndReason = "CLEANUP" )
func (TrackEndReason) MayStartNext ¶
func (e TrackEndReason) MayStartNext() bool
type TrackExceptionEvent ¶
type TrackExceptionEvent struct { EncodedTrack string `json:"encodedTrack"` Exception Exception `json:"exception"` GuildID_ snowflake.ID `json:"guildId"` }
func (TrackExceptionEvent) GuildID ¶
func (e TrackExceptionEvent) GuildID() snowflake.ID
func (TrackExceptionEvent) Op ¶
func (TrackExceptionEvent) Op() Op
func (TrackExceptionEvent) Type ¶
func (TrackExceptionEvent) Type() EventType
type TrackStartEvent ¶
type TrackStartEvent struct { EncodedTrack string `json:"encodedTrack"` GuildID_ snowflake.ID `json:"guildId"` }
func (TrackStartEvent) GuildID ¶
func (e TrackStartEvent) GuildID() snowflake.ID
func (TrackStartEvent) Op ¶
func (TrackStartEvent) Op() Op
func (TrackStartEvent) Type ¶
func (TrackStartEvent) Type() EventType
type TrackStuckEvent ¶
type TrackStuckEvent struct { EncodedTrack string `json:"encodedTrack"` ThresholdMs int `json:"thresholdMs"` GuildID_ snowflake.ID `json:"guildId"` }
func (TrackStuckEvent) GuildID ¶
func (e TrackStuckEvent) GuildID() snowflake.ID
func (TrackStuckEvent) Op ¶
func (TrackStuckEvent) Op() Op
func (TrackStuckEvent) Type ¶
func (TrackStuckEvent) Type() EventType
type UnknownEvent ¶
type UnknownEvent struct { Type_ EventType `json:"type"` GuildID_ snowflake.ID `json:"guildId"` Data json.RawMessage `json:"-"` }
func (UnknownEvent) GuildID ¶
func (e UnknownEvent) GuildID() snowflake.ID
func (UnknownEvent) MarshalJSON ¶
func (e UnknownEvent) MarshalJSON() ([]byte, error)
func (UnknownEvent) Op ¶
func (UnknownEvent) Op() Op
func (UnknownEvent) Type ¶
func (e UnknownEvent) Type() EventType
func (*UnknownEvent) UnmarshalJSON ¶
func (e *UnknownEvent) UnmarshalJSON(data []byte) error
type UnknownMessage ¶
type UnknownMessage struct { Op_ Op `json:"op"` Data json.RawMessage `json:"-"` }
func (UnknownMessage) MarshalJSON ¶
func (e UnknownMessage) MarshalJSON() ([]byte, error)
func (UnknownMessage) Op ¶
func (m UnknownMessage) Op() Op
func (*UnknownMessage) UnmarshalJSON ¶
func (e *UnknownMessage) UnmarshalJSON(data []byte) error
type VoiceState ¶
type WebSocketClosedEvent ¶
type WebSocketClosedEvent struct { Code int `json:"code"` Reason string `json:"reason"` ByRemote bool `json:"byRemote"` GuildID_ snowflake.ID `json:"guildId"` }
func (WebSocketClosedEvent) GuildID ¶
func (e WebSocketClosedEvent) GuildID() snowflake.ID
func (WebSocketClosedEvent) Op ¶
func (WebSocketClosedEvent) Op() Op
func (WebSocketClosedEvent) Type ¶
func (WebSocketClosedEvent) Type() EventType
Click to show internal directories.
Click to hide internal directories.