Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
yokonsan committed May 31, 2023
1 parent 5a24a2b commit 7b18bba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ uvicorn==0.22.0
pydantic~=1.10.7
aiohttp~=3.8.4
loguru==0.7.0
aiofiles==23.1.0
aiofiles==23.1.0
python-multipart==0.0.6
12 changes: 8 additions & 4 deletions task/bot/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from loguru import logger

from task.bot import TriggerStatus
from task.bot._typing import Attachment, CallbackData
from lib.api.callback import callback
from task.bot.handler import match_trigger_id, set_temp, pop_temp, get_temp, TEMP_MAP, callback_trigger, \
from task.bot.handler import (
match_trigger_id,
set_temp,
pop_temp,
get_temp,
callback_trigger,
callback_describe
)

intents = Intents.default()
intents.message_content = True
Expand Down Expand Up @@ -78,10 +82,10 @@ async def on_message_delete(message: Message):
if not trigger_id:
return

logger.debug(f"on_message_delete: {message.content, TEMP_MAP}")
if get_temp(trigger_id) is None:
return

logger.debug(f"on_message_delete: {message.content}")
logger.warning(f"sensitive content: {message.content}")
trigger_status = TriggerStatus.banned.value
pop_temp(trigger_id)
Expand Down

0 comments on commit 7b18bba

Please sign in to comment.