Skip to content

Commit 007835f

Browse files
authored
Add a warning message to people who DM the main bot (#1334)
1 parent 16624a5 commit 007835f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

techsupport_bot/bot.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def __init__(
7878
)
7979
)
8080
self.command_execute_history: dict[str, dict[int, bool]] = {}
81+
self.notified_dm_log: list[int] = []
8182

8283
# Loads the file config, which includes things like the token
8384
self.load_file_config()
@@ -265,6 +266,13 @@ async def on_message(self: Self, message: discord.Message) -> None:
265266
and message.author.id != owner.id
266267
and not message.author.bot
267268
):
269+
if message.author.id not in self.notified_dm_log:
270+
self.notified_dm_log.append(message.author.id)
271+
await message.author.send(
272+
"All DMs sent to this bot are permanently logged and not "
273+
"regularly checked. No responses will be given to any messages."
274+
)
275+
268276
attachment_urls = ", ".join(a.url for a in message.attachments)
269277
content_string = f'"{message.content}"' if message.content else ""
270278
attachment_string = f"({attachment_urls})" if attachment_urls else ""

0 commit comments

Comments
 (0)