From 089c253d1da7f467ba42361b65934418b2c00ee0 Mon Sep 17 00:00:00 2001 From: zephyrkul Date: Mon, 17 Aug 2020 16:20:03 -0600 Subject: [PATCH] [ctx] Suppress all mentions in maybe_send_embed (#4192) * [ctx] Suppress all mentions in maybe_send_embed Whether this method should mention shouldn't be tied to an unrelated setting. * black * Update changelog_3_4_0.rst Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com> --- docs/changelog_3_4_0.rst | 1 + redbot/core/commands/context.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog_3_4_0.rst b/docs/changelog_3_4_0.rst index 86c942e64..b33b3dce3 100644 --- a/docs/changelog_3_4_0.rst +++ b/docs/changelog_3_4_0.rst @@ -90,6 +90,7 @@ Breaking changes - see `discord.AllowedMentions` and ``allowed_mentions`` kwarg of ``.send()`` methods, if your cog requires to mention roles or ``@everyone/@here`` +- `Context.maybe_send_embed()` now supresses all mentions, including user mentions (:issue:`4192`) - The default value of the ``filter`` keyword argument has been changed to ``None`` (:issue:`3845`) - Cog package names (i.e. name of the folder the cog is in and the name used when loading the cog) now have to be `valid Python identifiers `_ (:issue:`3605`, :issue:`3679`) - Method/attribute names starting with ``red_`` or being in the form of ``__red_*__`` are now reserved. See `version_guarantees` for more information (:issue:`4085`) diff --git a/redbot/core/commands/context.py b/redbot/core/commands/context.py index c899aa4a6..a2dab2495 100644 --- a/redbot/core/commands/context.py +++ b/redbot/core/commands/context.py @@ -255,7 +255,10 @@ class Context(DPYContext): embed=discord.Embed(description=message, color=(await self.embed_colour())) ) else: - return await self.send(message) + return await self.send( + message, + allowed_mentions=discord.AllowedMentions(everyone=False, roles=False, users=False), + ) @property def clean_prefix(self) -> str: