Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GopalSaraf committed Nov 29, 2021
1 parent b23f249 commit b536b10
Show file tree
Hide file tree
Showing 10 changed files with 439 additions and 157 deletions.
10 changes: 9 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,15 @@
"required": false
},
"CLONE_COMMAND_G": {
"description": "Enter your custom gclone command. Default is /gclone",
"description": "Enter your custom clone command. Default is /clone",
"required": false
},
"CLONE_ZIP_COMMAND": {
"description": "Enter your custom clonezip command. Default is /clonezip",
"required": false
},
"CLONE_TAR_COMMAND": {
"description": "Enter your custom clonetar command. Default is /clonetar",
"required": false
},
"LIST_COMMAND": {
Expand Down
4 changes: 3 additions & 1 deletion tobrot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@
PYTDL_COMMAND = os.environ.get("PYTDL_COMMAND", "pytdl")
GPYTDL_COMMAND = os.environ.get("GPYTDL_COMMAND", "gpytdl")
LOG_COMMAND = os.environ.get("LOG_COMMAND", "log")
CLONE_COMMAND_G = os.environ.get("CLONE_COMMAND_G", "gclone")
CLONE_COMMAND_G = os.environ.get("CLONE_COMMAND_G", "clone")
CLONE_ZIP_COMMAND = os.environ.get("CLONE_ZIP_COMMAND", "clonezip")
CLONE_TAR_COMMAND = os.environ.get("CLONE_TAR_COMMAND", "clonetar")
UPLOAD_COMMAND = os.environ.get("UPLOAD_COMMAND", "upload")
RENEWME_COMMAND = os.environ.get("RENEWME_COMMAND", "renewme")
RENAME_COMMAND = os.environ.get("RENAME_COMMAND", "rename")
Expand Down
26 changes: 17 additions & 9 deletions tobrot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
TOGGLE_DOC,
HELP_COMMAND,
LIST_COMMAND,
COMPLETE_LIST_COMMAND,
COMPLETE_LIST_COMMAND, CLONE_ZIP_COMMAND, CLONE_TAR_COMMAND,
)
from tobrot.helper_funcs.download import down_load_media_f
from tobrot.helper_funcs.help_func import help_message_f
Expand All @@ -46,6 +46,7 @@
from tobrot.plugins.custom_thumbnail import clear_thumb_nail, save_thumb_nail
from tobrot.plugins.incoming_message_fn import (
g_clonee,
gclone_zip,
g_yt_playlist,
incoming_message_f,
incoming_purge_message_f,
Expand Down Expand Up @@ -112,20 +113,27 @@
#
incoming_clone_handler = MessageHandler(
g_clonee,
filters=filters.command([f"{CLONE_COMMAND_G}"])
filters=filters.command([CLONE_COMMAND_G])
& filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(incoming_clone_handler)
#
incoming_clonezip_handler = MessageHandler(
gclone_zip,
filters=filters.command([CLONE_ZIP_COMMAND, CLONE_TAR_COMMAND])
& filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(incoming_clonezip_handler)
#
incoming_size_checker_handler = MessageHandler(
check_size_g,
filters=filters.command([f"{GET_SIZE_G}"]) & filters.chat(chats=AUTH_CHANNEL),
filters=filters.command([GET_SIZE_G]) & filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(incoming_size_checker_handler)
#
incoming_g_clear_handler = MessageHandler(
g_clearme,
filters=filters.command([f"{RENEWME_COMMAND}"])
filters=filters.command([RENEWME_COMMAND])
& filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(incoming_g_clear_handler)
Expand All @@ -146,7 +154,7 @@
#
status_message_handler = MessageHandler(
status_message_f,
filters=filters.command([f"{STATUS_COMMAND}"])
filters=filters.command([STATUS_COMMAND])
& filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(status_message_handler)
Expand All @@ -160,7 +168,7 @@
#
cancel_message_handler = MessageHandler(
cancel_message_f,
filters=filters.command([f"{CANCEL_COMMAND_G}"])
filters=filters.command([CANCEL_COMMAND_G])
& filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(cancel_message_handler)
Expand All @@ -179,20 +187,20 @@
#
rename_message_handler = MessageHandler(
rename_tg_file,
filters=filters.command([f"{RENAME_COMMAND}"]) & filters.chat(chats=AUTH_CHANNEL),
filters=filters.command([RENAME_COMMAND]) & filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(rename_message_handler)
#
upload_document_handler = MessageHandler(
upload_document_f,
filters=filters.command([f"{UPLOAD_COMMAND}"])
filters=filters.command([UPLOAD_COMMAND])
& filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(upload_document_handler)
#
upload_log_handler = MessageHandler(
upload_log_file,
filters=filters.command([f"{LOG_COMMAND}"]) & filters.chat(chats=AUTH_CHANNEL),
filters=filters.command([LOG_COMMAND]) & filters.chat(chats=AUTH_CHANNEL),
)
app.add_handler(upload_log_handler)
#
Expand Down
Loading

0 comments on commit b536b10

Please sign in to comment.