Browse Source

Change TypeError to ValueError

pull/10230/head
blord0 1 month ago
parent
commit
0f3bc42878
  1. 4
      discord/file.py

4
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)

Loading…
Cancel
Save