Browse Source

stylize ban message and add filter info to /meta

master
Anonymous 4 months ago
parent
commit
9d678ee532
2 changed files with 10 additions and 7 deletions
  1. 9
    6
      antipedo.py
  2. 1
    1
      tools.py

+ 9
- 6
antipedo.py View File

@@ -1,5 +1,5 @@
from magic import Magic
from os import remove
from os import remove,linesep
import logging
from imagehash import average_hash
from PIL import Image
@@ -78,10 +78,10 @@ def checkNewMember(update, context):

if updater.bot.getChatMember( chat.id,updater.bot.id ).can_restrict_members:
updater.bot.kick_chat_member(chat.id, member.id)
text="Known pedo joined to group. Automatically banned."
action='Automatically banned.'
else:
# If the bot doesn't have admin previleges, send a warning message to the admins of group instead.
text=f"Known pedo {member.full_name} joined to group. Reported to group moderators."
action='Reported to group moderators.'
for op in [ i.user for i in update.effective_chat.get_administrators() if not i.user.is_bot]:
try:
op.send_message(
@@ -94,8 +94,10 @@ def checkNewMember(update, context):
debug.warning(f"[ERROR] {repr(error)} - {str(error)}")
else:
mods+=1
debug.warning(f"[ACTION] {text.replace(' mod',f' {mods} mod')} ID:{member.id} \nReason:{reason}")
try:update.message.reply_text(f"{text}\n\nReason: {reason}",quote=True)
debug.warning(f"[ACTION] {action.replace(' mod',f' {mods} mod')} ID:{member.id} \n{' '*26}Guilt: {reason.replace(linesep,' ')}")
try:update.message.reply_text(
f'Known pedo <a href="tg://user?id={member.id}">{member.full_name}</a> joined to group. {action}\n\n'
f'<b>Reason:</b> {reason}', quote=True, parse_mode="html")
except BadRequest as error: debug.warning(f"[ERROR] {repr(error)} - {str(error)}")


@@ -228,11 +230,12 @@ def batchBlacklist(update,context):
def metaInformation(update,context):
blacklist = load_json("blacklist.json")
meta = load_json("meta.json")
filtre = load_json("filter.json")
update.message.reply_text(
f"Currently {len(blacklist)-1} pedos on blacklist. "
f"{meta['banned']} pedophiles were banned "
f"and {meta['reported']} reports received. "
f"Protecting {len(chan_list)} groups."
f"Protecting {len(chan_list)} groups. {len(filtre)} CP media on filter so far."
)

def giveOP(update,context):

+ 1
- 1
tools.py View File

@@ -47,7 +47,7 @@ You can check exposed users at @Pedo_Hunters_Channel.
- if the evidence is compelling we post it and blacklist the user

<u><b>How trustworthy your blacklist is?</b></u>
We don't blacklist users unless we have concrete evidence. If CP was shared in one of the groups you were participating in that's not your fault. But if CP was regularly shared or neither the mods nor the users took action against the content, continuing to participate is your fault.
We don't blacklist users unless we have concrete evidence. If CP was shared in one of the groups you were participating in that's not your fault. But if CP was regularly shared or neither the mods nor the users took action against the content, continuing to participate is your fault. If you still think you were accidentally added to blacklist contact us using /report command.

<u><b>How can I use this bot?</b></u>
You can add the bot to your group and give it ban permission if you want. Your moderators of group have to start the bot in order to receive PM alert messages. To feedback or report an incident, you can use /report option. To check status of the bot, use /meta command.

Loading…
Cancel
Save