~.player
Player
QueuedAudio
dataclass
QueuedAudio(source: AudioSource, origin: AudioBeginOrigin)
Audio metadata in player queue.
AudioPlaybackState
Bases: IntEnum
The current state of the player's playback.
BUFFERING
class-attribute
instance-attribute
BUFFERING = 0
The player is loading the current audio.
IDLE
class-attribute
instance-attribute
IDLE = 1
The player is not currently playing any audio.
PAUSED
class-attribute
instance-attribute
PAUSED = 2
The player is currently paused.
PLAYING
class-attribute
instance-attribute
PLAYING = 3
The player is currently playing audio.
STOPPING
class-attribute
instance-attribute
STOPPING = 4
The player is stopping.
AudioPlayer
AudioPlayer(connection: VoiceConnection)
Responsible for all audio.
Create a new audio player.
| PARAMETER | DESCRIPTION |
|---|---|
connection
|
The active voice connection.
TYPE:
|
connection
property
connection: VoiceConnection
The active connection that is responsible for this player.
progress
property
progress: float
Percentage of the current audio that has been completed (0.0-1.0).
add_queue
async
add_queue(
source: AudioSource, *, autoplay: bool = True
) -> Result
Add an audio source to the queue.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The source of the audio to add.
TYPE:
|
autoplay
|
If the player should play this source if there's no audio currently loaded.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
add_queue_bulk
async
add_queue_bulk(
sources: Iterable[AudioSource], *, autoplay: bool = True
) -> Result
Add a list of audio sources to the queue.
| PARAMETER | DESCRIPTION |
|---|---|
sources
|
The sources of audio to add.
TYPE:
|
autoplay
|
If the player should play the first source if there's no audio currently loaded.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
|
ValueError
|
If |
clear_history
async
clear_history() -> Result
Clear all audio from history.
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
clear_queue
async
clear_queue() -> Result
Clear all audio from the queue.
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
next
async
next() -> Result
Play the next audio in queue.
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
pause
async
pause() -> Result
Pause the current audio.
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
play
async
play(source: AudioSource) -> Result
Play audio from a source.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The source of the audio to play
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the provided source doesn't inherit |
previous
async
previous() -> Result
Play the latest previously played audio.
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
remove_queue
async
remove_queue(source: AudioSource) -> Result
Remove an audio source from the queue.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
The source of the audio to remove.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If the provided source doesn't inherit |
resume
async
resume() -> Result
Resume the current audio.
| RETURNS | DESCRIPTION |
|---|---|
Result
|
If the operation was successful, with reason provided if otherwise. |
set_priority
set_priority(priority: bool) -> None
set_volume
Set the default volume of this player.
Can be None, any scaled value (1.0, 2.0, 0.5, etc.) or dB-based (-3dB, 0.5dB, etc.).
| PARAMETER | DESCRIPTION |
|---|---|
volume
|
The volume to set as a default for this player - |
| RAISES | DESCRIPTION |
|---|---|
TypeError
|
If |