Makes bot.send_filtered return the message that is sent (#3052)

* Makes bot.send_filtered return the sent msg

* Create 3052.enhance.rst

* :that:

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Flame442 2019-10-13 19:32:24 -04:00 committed by Michael H
parent 36f494ba63
commit 428bf55480
2 changed files with 7 additions and 1 deletions

View File

@ -0,0 +1 @@
``bot.send_filtered`` now returns the message that is sent.

View File

@ -690,6 +690,11 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
This should realistically only be used for responding using user provided This should realistically only be used for responding using user provided
input. (unfortunately, including usernames) input. (unfortunately, including usernames)
Manually crafted messages which dont take any user input have no need of this Manually crafted messages which dont take any user input have no need of this
Returns
-------
discord.Message
The message that was sent.
""" """
content = kwargs.pop("content", None) content = kwargs.pop("content", None)
@ -702,7 +707,7 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
if filter_all_links: if filter_all_links:
content = common_filters.filter_urls(content) content = common_filters.filter_urls(content)
await destination.send(content=content, **kwargs) return await destination.send(content=content, **kwargs)
def add_cog(self, cog: commands.Cog): def add_cog(self, cog: commands.Cog):
if not isinstance(cog, commands.Cog): if not isinstance(cog, commands.Cog):