Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions any_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ async def download_file(message, url, file_name):
pass
return file_name

image_ext = tuple([".jpg", ".png", ".jpeg"])
vid_ext = tuple([".mp4", ".mkv"])
sticker_ext = tuple([".wepb", ".tgs"])
song_ext = tuple([".mp3", ".wav", ".m4a"])
image_ext = ".jpg", ".png", ".jpeg"
vid_ext = ".mp4", ".mkv"
sticker_ext = ".wepb", ".tgs"
song_ext = ".mp3", ".wav", ".m4a"
Comment on lines -71 to +74
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 71-74 refactored with the following changes:


async def upload_file(client, reply_message, message, file_path, caption):
rndm = uuid.uuid4().hex
Expand Down
14 changes: 7 additions & 7 deletions harem.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ async def remove_nsfw(client, message):

async def is_harem_enabled(f, client, message):
if Config.ENABLE_WAIFU_FOR_ALL_CHATS:
return bool(True)
return bool(True) if await is_chat_in_db(int(message.chat.id)) else bool(False)
return True
return bool(await is_chat_in_db(int(message.chat.id)))
Comment on lines -89 to +90
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function is_harem_enabled refactored with the following changes:


async def harem_event(f, client, message):
if not message:
return bool(False)
return False
if not message.photo:
return bool(False)
return False
if not message.caption:
return bool(False)
return False
if "add" in message.caption.lower():
return bool(True)
return bool(False)
return True
return False
Comment on lines -94 to +101
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function harem_event refactored with the following changes:


@run_in_exc
def get_data(img):
Expand Down
2 changes: 1 addition & 1 deletion helper_files/dl_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,5 @@ def find_between(start_string, end_string, to_find):
result = re.search(_to_, to_find)
if not result:
return None
return result.group(1)
return result[1]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function find_between refactored with the following changes:


3 changes: 2 additions & 1 deletion unzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ async def test(client, message):
end = datetime.now()
ms = (end - start).seconds
await Pablo.edit(
"Stored the zip to `{}` in {} seconds.".format(downloaded_file_name, ms)
f"Stored the zip to `{downloaded_file_name}` in {ms} seconds."
)

Comment on lines -48 to +50
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function test refactored with the following changes:

try:
with zipfile.ZipFile(downloaded_file_name, "r") as zip_ref:
zip_ref.extractall(extracted)
Expand Down