From cc1776a76788ac684f7f03bde720b5e22b21606c Mon Sep 17 00:00:00 2001 From: Ethan <47520067+Skelmis@users.noreply.github.com> Date: Sat, 24 Feb 2024 06:32:34 +1300 Subject: [PATCH] docs: add clarification to executable param (#1158) --- changelog/1158.doc.rst | 1 + disnake/player.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 changelog/1158.doc.rst diff --git a/changelog/1158.doc.rst b/changelog/1158.doc.rst new file mode 100644 index 0000000000..3a79ab60be --- /dev/null +++ b/changelog/1158.doc.rst @@ -0,0 +1 @@ +Adding some clarifying documentation around the executable parameters of audio classes based off of internal discussions. diff --git a/disnake/player.py b/disnake/player.py index 3ff094d4d6..45c666f7f7 100644 --- a/disnake/player.py +++ b/disnake/player.py @@ -126,6 +126,12 @@ class FFmpegAudio(AudioSource): :class:`FFmpegOpusAudio` work should subclass this. .. versionadded:: 1.3 + + .. danger:: + + As this wraps a subprocess call, ensure that + arguments such as ``executable`` are not + set from direct user input. """ def __init__( @@ -240,6 +246,11 @@ class FFmpegPCMAudio(FFmpegAudio): passed to the stdin of ffmpeg. executable: :class:`str` The executable name (and path) to use. Defaults to ``ffmpeg``. + + .. danger:: + + As this wraps a subprocess call, ensure that + this argument is not set from direct user input. pipe: :class:`bool` If ``True``, denotes that ``source`` parameter will be passed to the stdin of ffmpeg. Defaults to ``False``. @@ -342,6 +353,11 @@ class FFmpegOpusAudio(FFmpegAudio): executable: :class:`str` The executable name (and path) to use. Defaults to ``ffmpeg``. + + .. danger:: + + As this wraps a subprocess call, ensure that + this argument is not set from direct user input. pipe: :class:`bool` If ``True``, denotes that ``source`` parameter will be passed to the stdin of ffmpeg. Defaults to ``False``.