mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -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:
parent
36f494ba63
commit
428bf55480
1
changelog.d/3052.enhance.rst
Normal file
1
changelog.d/3052.enhance.rst
Normal file
@ -0,0 +1 @@
|
||||
``bot.send_filtered`` now returns the message that is sent.
|
||||
@ -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):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user