Skip to content

Commit 754338a

Browse files
authored
Fixed bugs
Default value for file and files keyword argument changed from None to MISSING
1 parent fe7fca6 commit 754338a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

discord/message.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,10 +1314,10 @@ async def edit(
13141314
else:
13151315
payload['components'] = []
13161316

1317-
if file is not None and files is not None:
1318-
raise InvalidArgument('cannot pass both file and files parameter to send()')
1317+
if file is not MISSING and files is not MISSING:
1318+
raise InvalidArgument('cannot pass both file and files parameter to edit()')
13191319

1320-
if file is not None:
1320+
if file is not MISSING:
13211321
if not isinstance(file, File):
13221322
raise InvalidArgument('file parameter must be File')
13231323

@@ -1337,7 +1337,7 @@ async def edit(
13371337
finally:
13381338
file.close()
13391339

1340-
elif files is not None:
1340+
elif files is not MISSING:
13411341
if len(files) > 10:
13421342
raise InvalidArgument('files parameter must be a list of up to 10 elements')
13431343
elif not all(isinstance(file, File) for file in files):

0 commit comments

Comments
 (0)