aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Akarys42 <[email protected]>2019-10-26 11:11:15 +0200
committerGravatar Akarys42 <[email protected]>2019-10-26 11:11:15 +0200
commit95c6e56891a21ebb2d1555cf850daad375d57afe (patch)
tree511311b4eef183538d76c2a1f2902f0da12f6475
parentMerge branch 'master' into #364-offensive-msg-autodeletion (diff)
Switch to datetime.datetime
-rw-r--r--bot/cogs/filtering.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bot/cogs/filtering.py b/bot/cogs/filtering.py
index 5bd72a584..8962a85c1 100644
--- a/bot/cogs/filtering.py
+++ b/bot/cogs/filtering.py
@@ -187,25 +187,25 @@ class Filtering(Cog, Scheduler):
except discord.errors.NotFound:
return
+ # Notify the user if the filter specifies
+ if _filter["user_notification"]:
+ await self.notify_member(msg.author, _filter["notification_msg"], msg.channel)
+
# If the message is classed as offensive, we store it in the site db and
# it will be deleted it after one week.
if _filter["schedule_deletion"]:
- delete_date = msg.created_at.date() + OFFENSIVE_MSG_DELETE_TIME
+ delete_date = msg.created_at + OFFENSIVE_MSG_DELETE_TIME
await self.bot.api_client.post(
'bot/offensive-message',
json={
'id': msg.id,
'channel_id': msg.channel.id,
- 'delete_date': delete_date.isoformat()
+ 'delete_date': delete_date.isoformat()[:-1]
}
)
log.trace(f"Offensive message will be deleted on "
f"{delete_date.isoformat()}")
- # Notify the user if the filter specifies
- if _filter["user_notification"]:
- await self.notify_member(msg.author, _filter["notification_msg"], msg.channel)
-
if isinstance(msg.channel, DMChannel):
channel_str = "via DM"
else: