Skip to content

Commit d922683

Browse files
committed
silent_alert_on_mention, resolve #2907
1 parent e8be5d1 commit d922683

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

bot.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def run(self, *args, **kwargs):
195195
intents = discord.Intents.default()
196196
intents.members = True
197197
# Try again with members intent
198-
super().__init__(command_prefix=None, intents=intents) # implemented in `get_prefix`
198+
self._connection._intents = intents
199199
logger.warning("Attempting to login with only the server members privileged intent. Some plugins might not work correctly.")
200200
try:
201201
self.loop.run_until_complete(self.start(self.token))
@@ -1060,7 +1060,12 @@ async def on_message(self, message):
10601060
)
10611061
if self.config["show_timestamp"]:
10621062
em.timestamp = datetime.utcnow()
1063-
await self.mention_channel.send(content=self.config["mention"], embed=em)
1063+
1064+
if not self.config["silent_alert_on_mention"]:
1065+
content = self.config["mention"]
1066+
else:
1067+
content = ""
1068+
await self.mention_channel.send(content=content, embed=em)
10641069

10651070
await self.process_commands(message)
10661071

core/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class ConfigManager:
7979
"close_on_leave": False,
8080
"close_on_leave_reason": "The recipient has left the server.",
8181
"alert_on_mention": False,
82+
"silent_alert_on_mention": False,
8283
"show_timestamp": True,
8384
"anonymous_snippets": False,
8485
# moderation
@@ -168,6 +169,7 @@ class ConfigManager:
168169
"transfer_reactions",
169170
"close_on_leave",
170171
"alert_on_mention",
172+
"silent_alert_on_mention",
171173
"show_timestamp",
172174
"confirm_thread_creation",
173175
"use_regex_autotrigger",

core/config_help.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,12 +662,23 @@
662662
},
663663
"alert_on_mention": {
664664
"default": "No",
665-
"description": "Mentions all mods (mention) in logs channel when bot is mentioned",
665+
"description": "Mentions all mods (mention) in mention channel when bot is mentioned",
666666
"examples":[
667667
"`{prefix}config set alert_on_mention yes`"
668668
],
669669
"notes": [
670-
"See also: `mention`"
670+
"See also: `mention`, `mention_channel_id`"
671+
]
672+
},
673+
"silent_alert_on_mention": {
674+
"default": "No",
675+
"description": "Send a message in the mention channel without mentioning all mods (mention).",
676+
"examples":[
677+
"`{prefix}config set alert_on_mention yes`"
678+
],
679+
"notes": [
680+
"This has no effect unless `alert_on_mention` is set to yes.",
681+
"See also: `mention`, `mention_channel_id`"
671682
]
672683
},
673684
"show_timestamp": {

0 commit comments

Comments
 (0)