Skip to content

Commit

Permalink
Merge pull request Pycord-Development#333 from Dorukyum/remove-duplic…
Browse files Browse the repository at this point in the history
…ate-file-checks

Remove duplicate file checks
  • Loading branch information
Dorukyum authored Oct 29, 2021
2 parents 9496c72 + 8de6034 commit 4fb38da
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 4fb38da

Please sign in to comment.