From 0f3bc42878167c9a2b0aaca664742abe3df0ab95 Mon Sep 17 00:00:00 2001 From: blord0 Date: Tue, 29 Jul 2025 00:43:03 +0100 Subject: [PATCH] Change TypeError to ValueError --- discord/file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/file.py b/discord/file.py index 206f9d780..e6d856bc9 100644 --- a/discord/file.py +++ b/discord/file.py @@ -226,7 +226,7 @@ class File: def generate_waveform(self) -> str: if not self.voice: - raise TypeError("Cannot produce waveform for non voice file") + raise ValueError("Cannot produce waveform for non voice file") self.reset() ogg = OggStream(self.fp) # type: ignore decoder = Decoder() @@ -237,7 +237,7 @@ class File: continue if b'vorbis' in packet: - raise TypeError("File format is 'vorbis'. Format of 'opus' is required for waveform generation") + raise ValueError("File format is 'vorbis'. Format of 'opus' is required for waveform generation") # these are PCM bytes in 16-bit signed little-endian form decoded = decoder.decode(packet, fec=False)