Skip to content

Commit

Permalink
✨ feat(controller): Add photo and document handling in group chats
Browse files Browse the repository at this point in the history
- Added logic to handle photo and document messages in group chats.
- Implemented image censorship using the pipeline_pass function.
- If an image is detected as potentially illegal, the bot will delete the message and warn the user.
- Added a command /report to report spam messages and perform image censorship on the replied message.
- Implemented checks for settings.rules and settings.mode to determine whether to perform censorship.
  • Loading branch information
sudoskys committed Jan 21, 2024
1 parent e99b5b9 commit a58a478
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,13 @@ async def report(message: types.Message):
if settings.mode.only_white:
if message.chat.id not in settings.mode.white_group:
return logger.info(f"White List Out {message.chat.id}")

if not message.reply_to_message:
return await bot.reply_to(
message, text="🍡 please reply to spam message with this command"
message,
text=f"🍡 please reply to spam message with this command ({message.chat.id})",
)
logger.info(f"Report in {message.chat.id} {message.from_user.id}")
reply_message = message.reply_to_message
reply_message_ph = reply_message.photo
reply_message_doc = reply_message.document
Expand Down

0 comments on commit a58a478

Please sign in to comment.