aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-08-06 14:02:27 +0200
committerGravatar kwzrd <[email protected]>2020-08-06 14:10:36 +0200
commitc9f2a2accea4a380eccec9f14fe389e230144242 (patch)
treea61f3c048be1925a32a28e1f83ec35e44df86b30
parentVerification: enable role pings (diff)
Verification: send DM to kicked members
-rw-r--r--bot/cogs/verification.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bot/cogs/verification.py b/bot/cogs/verification.py
index 2872e704a..ac488497a 100644
--- a/bot/cogs/verification.py
+++ b/bot/cogs/verification.py
@@ -57,6 +57,12 @@ If you'd like to unsubscribe from the announcement notifications, simply send `!
<#{constants.Channels.bot_commands}>.
"""
+# Sent via DMs to users kicked for failing to verify
+KICKED_MESSAGE = f"""
+Hi! You have been automatically kicked from Python Discord as you have failed to accept our rules \
+within `{KICKED_AFTER}` days. If this was an accident, please feel free to join again.
+"""
+
# Sent periodically in the verification channel
REMINDER_MESSAGE = f"""
<@&{constants.Roles.unverified}>
@@ -177,6 +183,8 @@ class Verification(Cog):
n_kicked, bad_statuses = 0, set()
for member in members:
+ with suppress(discord.Forbidden):
+ await member.send(KICKED_MESSAGE) # Send message while user is still in guild
try:
await member.kick(reason=f"User has not verified in {KICKED_AFTER} days")
except discord.HTTPException as http_exc: