Remove discord.InvalidArgument

This uses TypeError and ValueError instead.
This commit is contained in:
Josh
2022-02-26 16:44:49 +10:00
committed by GitHub
parent 86797dd9ab
commit 2b69b5d545
22 changed files with 342 additions and 176 deletions

View File

@ -35,7 +35,7 @@ import os.path
import struct
import sys
from .errors import DiscordException, InvalidArgument
from .errors import DiscordException
if TYPE_CHECKING:
T = TypeVar('T')
@ -447,7 +447,7 @@ class Decoder(_OpusStruct):
def decode(self, data: Optional[bytes], *, fec: bool = False) -> bytes:
if data is None and fec:
raise InvalidArgument("Invalid arguments: FEC cannot be used with null data")
raise TypeError("Invalid arguments: FEC cannot be used with null data")
if data is None:
frame_size = self._get_last_packet_duration() or self.SAMPLES_PER_FRAME