From 8de60348e4b11e673b250e39fecd485c70cb819b Mon Sep 17 00:00:00 2001 From: Dorukyum <53639936+Dorukyum@users.noreply.github.com> Date: Tue, 26 Oct 2021 22:33:43 +0300 Subject: [PATCH] Remove duplicate file checks --- discord/interactions.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 8646450a17..a1dcceb728 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -570,21 +570,6 @@ async def send_message( elif not all(isinstance(file, File) for file in files): raise InvalidArgument('files parameter must be a list of File') - if file is not None and files is not None: - raise InvalidArgument('cannot pass both file and files parameter to send()') - - if file is not None: - if not isinstance(file, File): - raise InvalidArgument('file parameter must be File') - else: - files = [file] - - if files is not None: - if len(files) > 10: - raise InvalidArgument('files parameter must be a list of up to 10 elements') - elif not all(isinstance(file, File) for file in files): - raise InvalidArgument('files parameter must be a list of File') - parent = self._parent adapter = async_context.get() try: @@ -840,4 +825,4 @@ async def inner_call(delay: float = delay): asyncio.create_task(inner_call()) else: - await self._state._interaction.delete_original_message() \ No newline at end of file + await self._state._interaction.delete_original_message()