aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dennis Pham <[email protected]>2020-07-13 12:00:15 -0400
committerGravatar GitHub <[email protected]>2020-07-13 12:00:15 -0400
commitebf0ec88c9c63f3536e2d59ec7d132b2ada2a955 (patch)
tree1734cb255a1441ca9b7547b142311fe195c1ae4a
parentFix rescheduling of edited infractions (diff)
parentMerge branch 'master' into 1038_allow_role_mentions_in_specific_areas (diff)
Merge pull request #1039 from python-discord/1038_allow_role_mentions_in_specific_areas
Allow role mentions in specific areas
-rw-r--r--bot/cogs/help_channels.py4
-rw-r--r--bot/cogs/moderation/modlog.py7
-rw-r--r--bot/cogs/sync/syncers.py7
-rw-r--r--config-default.yml2
4 files changed, 16 insertions, 4 deletions
diff --git a/bot/cogs/help_channels.py b/bot/cogs/help_channels.py
index 93ef07c84..4d0c534b0 100644
--- a/bot/cogs/help_channels.py
+++ b/bot/cogs/help_channels.py
@@ -614,11 +614,13 @@ class HelpChannels(commands.Cog):
channel = self.bot.get_channel(constants.HelpChannels.notify_channel)
mentions = " ".join(f"<@&{role}>" for role in constants.HelpChannels.notify_roles)
+ allowed_roles = [discord.Object(id_) for id_ in constants.HelpChannels.notify_roles]
message = await channel.send(
f"{mentions} A new available help channel is needed but there "
f"are no more dormant ones. Consider freeing up some in-use channels manually by "
- f"using the `{constants.Bot.prefix}dormant` command within the channels."
+ f"using the `{constants.Bot.prefix}dormant` command within the channels.",
+ allowed_mentions=discord.AllowedMentions(everyone=False, roles=allowed_roles)
)
self.bot.stats.incr("help.out_of_channel_alerts")
diff --git a/bot/cogs/moderation/modlog.py b/bot/cogs/moderation/modlog.py
index ffbb87bbe..0a63f57b8 100644
--- a/bot/cogs/moderation/modlog.py
+++ b/bot/cogs/moderation/modlog.py
@@ -121,7 +121,12 @@ class ModLog(Cog, name="ModLog"):
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/sync/syncers.py b/bot/cogs/sync/syncers.py
index 536455668..f7ba811bc 100644
--- a/bot/cogs/sync/syncers.py
+++ b/bot/cogs/sync/syncers.py
@@ -5,6 +5,7 @@ import typing as t
from collections import namedtuple
from functools import partial
+import discord
from discord import Guild, HTTPException, Member, Message, Reaction, User
from discord.ext.commands import Context
@@ -68,7 +69,11 @@ class Syncer(abc.ABC):
)
return None
- message = await channel.send(f"{self._CORE_DEV_MENTION}{msg_content}")
+ allowed_roles = [discord.Object(constants.Roles.core_developers)]
+ message = await channel.send(
+ f"{self._CORE_DEV_MENTION}{msg_content}",
+ allowed_mentions=discord.AllowedMentions(everyone=False, roles=allowed_roles)
+ )
else:
await message.edit(content=msg_content)
diff --git a/config-default.yml b/config-default.yml
index 64c4e715b..636b9db37 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -269,7 +269,7 @@ filter:
notify_user_domains: false
# Filter configuration
- ping_everyone: true # Ping @everyone when we send a mod-alert?
+ ping_everyone: true
offensive_msg_delete_days: 7 # How many days before deleting an offensive message?
guild_invite_whitelist: