aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2020-07-13 00:17:37 +0200
committerGravatar Leon Sandøy <[email protected]>2020-07-13 00:21:41 +0200
commit4527c038d21149d4d3fab73c54b9a1ad31e671c0 (patch)
tree92016f27abbeb4fcddc039da77e0841780717b13
parentRemove pointless comment (diff)
Revert "Ping @Moderators in ModLog"
Let's continue to use "@everyone" for now, and add an explicit allow for it so that it successfully pings people. There's a full justification for this in the pull request. https://github.com/python-discord/bot/issues/1038
-rw-r--r--bot/cogs/antispam.py4
-rw-r--r--bot/cogs/filtering.py2
-rw-r--r--bot/cogs/moderation/modlog.py17
-rw-r--r--bot/cogs/watchchannels/watchchannel.py4
-rw-r--r--bot/constants.py4
-rw-r--r--config-default.yml4
6 files changed, 20 insertions, 15 deletions
diff --git a/bot/cogs/antispam.py b/bot/cogs/antispam.py
index 71382bba9..0bcca578d 100644
--- a/bot/cogs/antispam.py
+++ b/bot/cogs/antispam.py
@@ -98,7 +98,7 @@ class DeletionContext:
text=mod_alert_message,
thumbnail=last_message.author.avatar_url_as(static_format="png"),
channel_id=Channels.mod_alerts,
- ping_moderators=AntiSpamConfig.ping_moderators
+ ping_everyone=AntiSpamConfig.ping_everyone
)
@@ -132,7 +132,7 @@ class AntiSpam(Cog):
await self.mod_log.send_log_message(
title="Error: AntiSpam configuration validation failed!",
text=body,
- ping_moderators=True,
+ ping_everyone=True,
icon_url=Icons.token_removed,
colour=Colour.red()
)
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py
index a5d59085f..76ea68660 100644
--- a/bot/cogs/filtering.py
+++ b/bot/cogs/filtering.py
@@ -329,7 +329,7 @@ class Filtering(Cog, Scheduler):
text=message,
thumbnail=msg.author.avatar_url_as(static_format="png"),
channel_id=Channels.mod_alerts,
- ping_moderators=Filter.ping_moderators,
+ ping_everyone=Filter.ping_everyone,
additional_embeds=additional_embeds,
additional_embeds_msg=additional_embeds_msg
)
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index a37a9faf5..0a63f57b8 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -15,7 +15,7 @@ from discord.ext.commands import Cog, Context
from discord.utils import escape_markdown
from bot.bot import Bot
-from bot.constants import Categories, Channels, Colours, Emojis, Event, Guild as GuildConstant, Icons, Roles, URLs
+from bot.constants import Categories, Channels, Colours, Emojis, Event, Guild as GuildConstant, Icons, URLs
from bot.utils.time import humanize_delta
log = logging.getLogger(__name__)
@@ -88,7 +88,7 @@ class ModLog(Cog, name="ModLog"):
text: str,
thumbnail: t.Optional[t.Union[str, discord.Asset]] = None,
channel_id: int = Channels.mod_log,
- ping_moderators: bool = False,
+ ping_everyone: bool = False,
files: t.Optional[t.List[discord.File]] = None,
content: t.Optional[str] = None,
additional_embeds: t.Optional[t.List[discord.Embed]] = None,
@@ -114,14 +114,19 @@ class ModLog(Cog, name="ModLog"):
if thumbnail:
embed.set_thumbnail(url=thumbnail)
- if ping_moderators:
+ if ping_everyone:
if content:
- content = f"<@&{Roles.moderators}>\n{content}"
+ content = f"@everyone\n{content}"
else:
- content = f"<@&{Roles.moderators}>"
+ content = "@everyone"
channel = self.bot.get_channel(channel_id)
- log_message = await channel.send(content=content, embed=embed, files=files)
+ log_message = await channel.send(
+ content=content,
+ embed=embed,
+ files=files,
+ allowed_mentions=discord.AllowedMentions(everyone=True)
+ )
if additional_embeds:
if additional_embeds_msg:
diff --git a/bot/cogs/watchchannels/watchchannel.py b/bot/cogs/watchchannels/watchchannel.py
index 8c4af4581..7c58a0fb5 100644
--- a/bot/cogs/watchchannels/watchchannel.py
+++ b/bot/cogs/watchchannels/watchchannel.py
@@ -120,7 +120,7 @@ class WatchChannel(metaclass=CogABCMeta):
await self.modlog.send_log_message(
title=f"Error: Failed to initialize the {self.__class__.__name__} watch channel",
text=message,
- ping_moderators=True,
+ ping_everyone=True,
icon_url=Icons.token_removed,
colour=Color.red()
)
@@ -132,7 +132,7 @@ class WatchChannel(metaclass=CogABCMeta):
await self.modlog.send_log_message(
title=f"Warning: Failed to retrieve user cache for the {self.__class__.__name__} watch channel",
text="Could not retrieve the list of watched users from the API and messages will not be relayed.",
- ping_moderators=True,
+ ping_everyone=True,
icon_url=Icons.token_removed,
colour=Color.red()
)
diff --git a/bot/constants.py b/bot/constants.py
index 34b312d2d..a1b392c82 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -225,7 +225,7 @@ class Filter(metaclass=YAMLGetter):
notify_user_invites: bool
notify_user_domains: bool
- ping_moderators: bool
+ ping_everyone: bool
offensive_msg_delete_days: int
guild_invite_whitelist: List[int]
domain_blacklist: List[str]
@@ -522,7 +522,7 @@ class AntiSpam(metaclass=YAMLGetter):
section = 'anti_spam'
clean_offending: bool
- ping_moderators: bool
+ ping_everyone: bool
punishment: Dict[str, Dict[str, int]]
rules: Dict[str, Dict[str, int]]
diff --git a/config-default.yml b/config-default.yml
index 0f6a25ef2..636b9db37 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -269,7 +269,7 @@ filter:
notify_user_domains: false
# Filter configuration
- ping_moderators: true
+ ping_everyone: true
offensive_msg_delete_days: 7 # How many days before deleting an offensive message?
guild_invite_whitelist:
@@ -428,7 +428,7 @@ urls:
anti_spam:
# Clean messages that violate a rule.
clean_offending: true
- ping_moderators: true
+ ping_everyone: true
punishment:
role_id: *MUTED_ROLE