diff --git a/changelog.d/3052.enhance.rst b/changelog.d/3052.enhance.rst new file mode 100644 index 000000000..76366d55f --- /dev/null +++ b/changelog.d/3052.enhance.rst @@ -0,0 +1 @@ +``bot.send_filtered`` now returns the message that is sent. diff --git a/redbot/core/bot.py b/redbot/core/bot.py index 33e02b653..636d515c2 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -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):