Skip to content

Commit

Permalink
Critical HOTFIX
Browse files Browse the repository at this point in the history
- Added REM_BG_API key to app.json (First time deployers can benefit.)

- Fixed broken #AutoApproved for good !! [now, no need to even '.approve' the person (in PM) now]

- Fixed "Removing background...." message not getting deleted after upload.
  • Loading branch information
Avinash Reddy authored Aug 18, 2019
1 parent 84be1c5 commit b8a6ba1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
"required": false
},
"OCR_SPACE_API_KEY": {
"description": "OCR API Key for .ocr command Get from https://ocr.space/ocrapi",
"description": "OCR API Key for .ocr command. Get from https://ocr.space/ocrapi",
"required": false
},
"REM_BG_API_KEY": {
"description": "API Key for .ocr command Get from https://www.remove.bg/api",
"description": "API Key for .rbg command. Get from https://www.remove.bg/api",
"required": false
},
"ANTI_SPAMBOT": {
Expand Down
6 changes: 6 additions & 0 deletions sample_config.env
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ GOOGLE_CHROME_BIN= ""
#
OCR_SPACE_API_KEY= ""

#
# remove.bg API Key for .rbg command
# Get from https://www.remove.bg/api
#
REM_BG_API_KEY= ""

#
# ChatID for the Log group
# Add a Hypen or a Negative Sign before ID
Expand Down
8 changes: 5 additions & 3 deletions userbot/modules/pmpermit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

from userbot import (COUNT_PM, CMD_HELP, BOTLOG, BOTLOG_CHATID,
PM_AUTO_BAN, LASTMSG, LOGS)

from userbot.events import register

# ========================= CONSTANTS ============================
Expand Down Expand Up @@ -118,12 +119,13 @@ async def auto_accept(event):
async for message in event.client.iter_messages(
event.chat_id, reverse=True, limit=1
):
if message.from_id == (await event.client.get_me()).id:
if message.message is not UNAPPROVED_MSG and message.from_id == (await event.client.get_me()).id:
try:
approve(chat.id)
approve(event.chat_id)
except IntegrityError:
return
if BOTLOG:

if is_approved(event.chat_id) and BOTLOG:
await event.client.send_message(
BOTLOG_CHATID,
"#AUTO-APPROVED\n"
Expand Down
1 change: 1 addition & 0 deletions userbot/modules/remove_bg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async def kbg(remob):
force_document=True,
reply_to=message_id
)
await remob.delete()
else:
await remob.edit("**Error (Invalid API key, I guess ?)**\n`{}`".format(output_file_name.content.decode("UTF-8")))

Expand Down

0 comments on commit b8a6ba1

Please sign in to comment.