mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
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:
@@ -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
|
||||
input. (unfortunately, including usernames)
|
||||
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)
|
||||
@@ -702,7 +707,7 @@ class RedBase(commands.GroupMixin, commands.bot.BotBase, RPCMixin): # pylint: d
|
||||
if filter_all_links:
|
||||
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):
|
||||
if not isinstance(cog, commands.Cog):
|
||||
|
||||
Reference in New Issue
Block a user