Skip to content

Commit 7d649da

Browse files
Actually check for files in the kwargs
Fix error editing 'None' as the content when no content provided
1 parent 995a164 commit 7d649da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord_slash/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ async def _slash_edit(self, **fields):
200200
"""
201201
_resp = {}
202202

203-
content = str(fields.get("content"))
203+
content = fields.get("content")
204204
if content:
205205
_resp["content"] = str(content)
206206

@@ -240,7 +240,7 @@ async def _slash_edit(self, **fields):
240240

241241
async def edit(self, **fields):
242242
"""Refer :meth:`discord.Message.edit`."""
243-
if ("file", "files") in fields:
243+
if "file" in fields or "files" in fields:
244244
await self._slash_edit(**fields)
245245
else:
246246
try:

0 commit comments

Comments
 (0)