Skip to content

Commit

Permalink
Merge pull request #63 from discordextremelist/TheMoksej-patch-3
Browse files Browse the repository at this point in the history
updating context to reference
  • Loading branch information
carolinaisslaying authored Mar 12, 2021
2 parents edbee6b + a92c954 commit d4cce75
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ async def send(self, content=None, *, tts=False, embed=None, file=None, files=No
pass
if reply:
return await reply.edit(content=content, embed=embed, delete_after=delete_after)
msg = await super().send(content=content, tts=tts, embed=embed, file=file, files=files,
delete_after=delete_after, nonce=nonce, allowed_mentions=allowed_mentions)
reference = self.message.reference
if reference and isinstance(reference.resolved, discord.Message):
msg = await reference.resolved.reply(content=content, tts=tts, embed=embed, file=file, files=files, delete_after=delete_after, nonce=nonce, allowed_mentions=allowed_mentions)
else:
msg = await super().send(content=content, tts=tts, embed=embed, file=file, files=files,
delete_after=delete_after, nonce=nonce, allowed_mentions=allowed_mentions)
self.bot.cmd_edits[self.message.id] = msg
return msg

Expand Down

0 comments on commit d4cce75

Please sign in to comment.