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 5664d5a commit 3143d01
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions app/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,7 @@ async def delete_or_warn(message: types.Message, reason: str):
),
formatting.mcode(reason),
]
deleted = False
try:
await self.bot.delete_message(
chat_id=message.chat.id, message_id=message.message_id
)
except Exception as er:
logger.error(er)
else:
deleted = True

if not deleted:
reply_messages.append("🔨 Delete Failed")
reply_messages.append(
" "
+ formatting.mlink("admin", f"tg://user?id={BotSetting.owner_id}")
)

reason_detail = formatting.format_text(*reply_messages, separator=" ")
try:
await self.bot.reply_to(
Expand Down

0 comments on commit 3143d01

Please sign in to comment.