Skip to content

Commit 3137598

Browse files
committed
Add anon_reply_without_command
1 parent 9c77931 commit 3137598

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

bot.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,16 @@ async def process_commands(self, message):
867867
except ValueError:
868868
reply_without_command = self.config.remove("reply_without_command")
869869

870-
if reply_without_command:
870+
try:
871+
anon_reply_without_command = strtobool(
872+
self.config["anon_reply_without_command"]
873+
)
874+
except ValueError:
875+
anon_reply_without_command = self.config.remove("anon_reply_without_command")
876+
877+
if anon_reply_without_command:
878+
await thread.reply(message, anonymous=True)
879+
elif reply_without_command:
871880
await thread.reply(message)
872881
else:
873882
await self.api.append_log(message, type_="internal")

core/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ConfigManager:
3636
"account_age": None,
3737
"guild_age": None,
3838
"reply_without_command": False,
39+
"anon_reply_without_command": False,
3940
# logging
4041
"log_channel_id": None,
4142
# threads
@@ -110,6 +111,7 @@ class ConfigManager:
110111
"user_typing",
111112
"mod_typing",
112113
"reply_without_command",
114+
"anon_reply_without_command",
113115
"recipient_thread_close",
114116
"thread_auto_close_silently",
115117
"thread_move_notify",

core/config_help.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,18 @@
111111
"`{prefix}config set reply_without_command no`"
112112
],
113113
"notes": [
114-
"Unfortunately, anonymous `reply_without_command` is currently not possible."
114+
"See also: `anon_reply_without_command`."
115+
]
116+
},
117+
"anon_reply_without_command": {
118+
"default": "Disabled",
119+
"description": "Setting this configuration will make all non-command messages sent in the thread channel to be anonymously forwarded to the recipient without the need of `{prefix}reply`.",
120+
"examples": [
121+
"`{prefix}config set anon_reply_without_command yes`",
122+
"`{prefix}config set anon_reply_without_command no`"
123+
],
124+
"notes": [
125+
"See also: `reply_without_command`."
115126
]
116127
},
117128
"log_channel_id": {

0 commit comments

Comments
 (0)