Skip to content

Commit

Permalink
Remove duplicate file checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum authored Oct 26, 2021
1 parent 6e2cb76 commit 8de6034
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions discord/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -840,4 +825,4 @@ async def inner_call(delay: float = delay):

asyncio.create_task(inner_call())
else:
await self._state._interaction.delete_original_message()
await self._state._interaction.delete_original_message()

0 comments on commit 8de6034

Please sign in to comment.