Skip to content

Commit 874978e

Browse files
committed
Fltering: clean up autoban code
1 parent 30612bc commit 874978e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bot/exts/filters/filter_lists.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ async def _add_data(
104104
# If it is an autoban trigger we send a warning in #mod-meta
105105
if comment and "[autoban]" in comment:
106106
await self.bot.get_channel(Channels.mod_meta).send(
107-
f":warning: heads-up! The new filter `{content}` (`{comment}`) will automatically ban users."
107+
f":warning: Heads-up! The new filter `{content}` (`{comment}`) will automatically ban users."
108108
)
109109

110110
# Insert the item into the cache

bot/exts/filters/filtering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import asyncio
22
import re
3-
from datetime import datetime, timedelta
3+
from datetime import timedelta
44
from typing import Any, Dict, List, Mapping, NamedTuple, Optional, Tuple, Union
55

66
import arrow
@@ -375,8 +375,8 @@ async def _filter_message(self, msg: Message, delta: Optional[int] = None) -> No
375375
await context.invoke(
376376
self.bot.get_command("tempban"),
377377
msg.author,
378-
datetime.now() + AUTO_BAN_DURATION,
379-
reason=AUTO_BAN_REASON.strip()
378+
arrow.utcnow() + AUTO_BAN_DURATION,
379+
reason=AUTO_BAN_REASON
380380
)
381381

382382
break # We don't want multiple filters to trigger

0 commit comments

Comments
 (0)