Skip to content

Commit

Permalink
docs: update message strings and readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
Itz-fork committed Dec 28, 2023
1 parent 62e49dd commit 9c7f6d5
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 29 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ A simple telegram bot to download, upload files or folders from [Mega.nz](https:


# Features
- Download, Upload files/folders easily ⚡
- No login required 🙅‍♂️
- Support for Mega.nz user account 🗃️
- Support for both private and public content 🤝
- DDL to mega.nz upload 🖇
- ⚡ Download, Upload files/folders easily
- 🙅‍♂️ No login required*
- 🗃️ Support for Mega.nz user account
- 🤝 Support for both private and public content
- 🛡 Can be used as either private or public bot
- 🖇 Direct download link to mega.nz upload


# Deploy
Expand Down
2 changes: 1 addition & 1 deletion megadl/helpers/crypt.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains code related to decryption functions
# Description: Decryption functions

# Ported from: https://github.com/Itz-fork/pyro-mega.py/blob/master/src/mega/crypto.py

Expand Down
5 changes: 5 additions & 0 deletions megadl/helpers/database.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Database functions

from megadl.lib.aiomongo import AioMongo

class Users:
Expand Down
2 changes: 1 addition & 1 deletion megadl/helpers/files.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains code related to fs functions
# Description: File system functions

from time import time
from shutil import rmtree
Expand Down
8 changes: 5 additions & 3 deletions megadl/helpers/mclient.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains code related to custom pyrogram.Client
# Description: Custom pyrogram client useful methods

import os
import asyncio
Expand Down Expand Up @@ -131,7 +131,9 @@ async def fn_run(client: Client, msg: Message):
can_use = uid in self.auth_users

if not can_use:
await msg.reply("You're not authorized to use this bot 😬")
await msg.reply(
"You're not authorized to use this bot 🙅‍♂️ \n\n**Join @NexaBotsUpdates ❤️**"
)
return msg.stop_propagation()

return await func(client, msg)
Expand Down Expand Up @@ -163,7 +165,7 @@ async def ask(self, chat_id: int, text: str, *args, **kwargs):
return await asyncio.wait_for(futr, 60.0)
except asyncio.TimeoutError:
await self.send_message(
chat_id, "Task was cancelled as you haven't answered for 1 minute"
chat_id, "Task was cancelled as you haven't answered for 1 minute 🥱"
)
self.listening.pop(chat_id, None)
return None
Expand Down
2 changes: 1 addition & 1 deletion megadl/helpers/sysfncs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains functions related to shell, async execution
# Description: Shell, loops and other sys functions


from functools import partial
Expand Down
9 changes: 5 additions & 4 deletions megadl/lib/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# About
Helper extensions for Mega.nz-Bot
Helper libraries for Mega.nz-Bot


# Extensions
1. [`megatools`](megatools.py) - Extension for pyrogram bots to interact with megatools cli
2. [`pyros`](pyros.py) - Helper tools for pyrogram
3. [`ddl`](ddl.py) - Download files using direct download links
- [`megatools`](megatools.py) - Wrapper for megatools cli with extended features
- [`aiomongo`](aiomongo.py) - Async wrapper for pymongo's insert, find, update and delete operations
- [`pyros`](pyros.py) - Tools and helper functions related to pyrogram
- [`ddl`](ddl.py) - Downloader for direct download links and gdrive
5 changes: 5 additions & 0 deletions megadl/lib/aiomongo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Async wrapper for pymongo's insert, find, update and delete operations

from os import getenv
from typing import Any
from bson.codec_options import TypeRegistry
Expand Down
2 changes: 1 addition & 1 deletion megadl/lib/ddl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Helper class for downloading direct download links
# Description: Downloader for direct download links and gdrive

import os

Expand Down
2 changes: 1 addition & 1 deletion megadl/lib/megatools.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Helper class for pyrogram bots to interact with megatools cli
# Description: Wrapper for megatools cli with extended features

import os
import subprocess
Expand Down
2 changes: 1 addition & 1 deletion megadl/lib/pyros.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains pyrogram tools
# Description: Tools and helper functions related to pyrogram

from time import time
from math import floor
Expand Down
2 changes: 1 addition & 1 deletion megadl/modules/auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains commands related to mega auth
# Description: Authorize mega account of users


from pyrogram import filters
Expand Down
2 changes: 1 addition & 1 deletion megadl/modules/callbacks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains global callbacks
# Description: Callbacks that can be used globally

from pyrogram import filters
from pyrogram.types import CallbackQuery
Expand Down
8 changes: 6 additions & 2 deletions megadl/modules/generals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Contains all the general commands of the bot
# Description: General commands of the bot


from pyrogram import filters
Expand All @@ -17,7 +17,11 @@ async def start_msg(_: MeganzClient, msg: Message):
f"""
Hi `{msg.from_user.first_name}` 👋, I'm [Mega.nz-Bot](https://github.com/Itz-fork/Mega.nz-Bot)!
I can help you download, upload files or folders from telegram. Not sure what to do? Check /help for more info 😇
I can help you download, upload files or folders from telegram.
Not sure what to do? Check /help for more info 😇
**Made with ❤️ by @NexaBotsUpdates**
""",
disable_web_page_preview=True,
)
Expand Down
4 changes: 2 additions & 2 deletions megadl/modules/mega_dl.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Responsible for download function
# Description: Handle mega.nz download function


import re
Expand Down Expand Up @@ -58,7 +58,7 @@ async def dl_from_cb(client: MeganzClient, query: CallbackQuery):
udoc = await client.database.is_there(qcid, True)
if not udoc and re.match(prv_rgx, url):
return await query.edit_message_text(
"You need to be logged in first to download this file 😑"
"You must be logged in first to download this file 😑"
)
if udoc:
conf = f"--username {client.cipher.decrypt(udoc[0]).decode()} --password {client.cipher.decrypt(udoc[1]).decode()}"
Expand Down
10 changes: 5 additions & 5 deletions megadl/modules/mega_up.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2023 Itz-fork
# Author: https://github.com/Itz-fork
# Project: https://github.com/Itz-fork/Mega.nz-Bot
# Description: Responsible for upload function
# Description: Handle mega.nz upload function

from time import time
from pyrogram import filters
Expand Down Expand Up @@ -36,7 +36,7 @@ async def to_up(_: MeganzClient, msg: Message):
"Select what you want to do 🤗",
reply_markup=InlineKeyboardMarkup(
[
[InlineKeyboardButton("Download 💾", callback_data=f"up_tgdl-{_mid}")],
[InlineKeyboardButton("Upload 🗃", callback_data=f"up_tgdl-{_mid}")],
[InlineKeyboardButton("Cancel ❌", callback_data=f"cancelqcb-{_mid}")],
]
),
Expand All @@ -57,7 +57,7 @@ async def to_up_cb(client: MeganzClient, query: CallbackQuery):
udoc = await client.database.is_there(qcid, True)
if not udoc:
return await query.edit_message_text(
"You need to be logged in first to download this file 😑"
"You must be logged in first to download this file 😑"
)
if udoc:
conf = f"--username {client.cipher.decrypt(udoc['email']).decode()} --password {client.cipher.decrypt(udoc['password']).decode()}"
Expand All @@ -66,7 +66,7 @@ async def to_up_cb(client: MeganzClient, query: CallbackQuery):
msg = await client.get_messages(qcid, _mid)
# Status msg
await client.edit_message_text(
qcid, qmid, "Trying to download the file 📬", reply_markup=None
qcid, qmid, "Trying to download the file 📥", reply_markup=None
)

# Download files accordingly
Expand All @@ -86,7 +86,7 @@ async def to_up_cb(client: MeganzClient, query: CallbackQuery):
await client.edit_message_text(
qcid,
qmid,
"Your file has been uploaded to Mega.nz ✅",
f"Your file has been uploaded to Mega.nz ✅ \n\nLink 🔗: `{limk}`",
reply_markup=InlineKeyboardMarkup(
[[InlineKeyboardButton("Visit 🔗", url=limk)]]
),
Expand Down

0 comments on commit 9c7f6d5

Please sign in to comment.