Browse Source

suspress some exceptions

master
Anonymous 3 months ago
parent
commit
49a4ff2ed4
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      antipedo.py

+ 7
- 3
antipedo.py View File

@@ -58,7 +58,9 @@ def checkNewMember(update, context):
for member in update.message.new_chat_members:
if member.id == updater.bot.id:
trackPublicChats(update,context)
return update.message.reply_text(BOT_ADDED_MESSAGE,quote=False)
try:update.message.reply_text(BOT_ADDED_MESSAGE,quote=False)
except Unauthorized as error: debug.warning(f"[ERROR] {repr(error)} - {str(error)}")
return

if not str(member.id) in blacklist:
continue
@@ -93,7 +95,8 @@ def checkNewMember(update, context):
else:
mods+=1
debug.warning(f"[ACTION] {text.replace(' mod',f' {mods} mod')} ID:{member.id} \nReason:{reason}")
return update.message.reply_text(f"{text}\n\nReason: {reason}",quote=True)
try:update.message.reply_text(f"{text}\n\nReason: {reason}",quote=True)
except BadRequest as error: debug.warning(f"[ERROR] {repr(error)} - {str(error)}")


def updateBlacklist(update,context):
@@ -256,7 +259,8 @@ def giveOP(update,context):
class Report:
def start(update,context):
if "private" != update.effective_chat.type:
update.message.reply_text("You must /report trough private chat.")
try:update.message.reply_text("You must /report trough private chat.")
except Exception as error: debug.warning(f"[ERROR] {repr(error)} - {str(error)}")
return ConversationHandler.END

context.user_data["messages"] = []

Loading…
Cancel
Save