From f8179c8c32d8a637c5c22fe625279290ff809a5b Mon Sep 17 00:00:00 2001
From: Hafitz Setya <71178188+breakdowns@users.noreply.github.com>
Date: Thu, 3 Jun 2021 03:56:39 +0700
Subject: [PATCH] Fix typo
---
Dockerfile | 2 +-
bot/__main__.py | 3 +--
bot/modules/authorize.py | 10 +++++-----
bot/modules/clone.py | 14 +++++++-------
bot/modules/count.py | 15 ++++++++-------
bot/modules/list.py | 2 +-
bot/modules/mirror_status.py | 7 ++++---
bot/modules/stickers.py | 30 +++++++++++++++---------------
8 files changed, 42 insertions(+), 41 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index e5be25b60f6..ead62150698 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -23,7 +23,7 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
COPY . .
COPY .netrc /root/.netrc
-Run chmod 600 /usr/src/app/.netrc
+RUN chmod 600 /usr/src/app/.netrc
RUN chmod +x aria.sh
CMD ["bash","start.sh"]
diff --git a/bot/__main__.py b/bot/__main__.py
index f02ba3a6f2c..35b45482138 100644
--- a/bot/__main__.py
+++ b/bot/__main__.py
@@ -52,7 +52,7 @@ def stats(update, context):
@run_async
def start(update, context):
start_string = f'''
-This bot can mirror all your links to Google drive!
+This bot can mirror all your links to Google Drive!
Type /{BotCommands.HelpCommand} to get a list of available commands
'''
buttons = button_build.ButtonMaker()
@@ -220,7 +220,6 @@ def main():
chat_id, msg_id = map(int, f)
bot.edit_message_text("Restarted successfully!", chat_id, msg_id)
os.remove(".restartmsg")
-
bot.set_my_commands(botcmds)
start_handler = CommandHandler(BotCommands.StartCommand, start)
diff --git a/bot/modules/authorize.py b/bot/modules/authorize.py
index d0613558a04..25221e38d79 100644
--- a/bot/modules/authorize.py
+++ b/bot/modules/authorize.py
@@ -10,7 +10,7 @@
@run_async
-def authorize(update,context):
+def authorize(update, context):
reply_message = None
message_ = None
reply_message = update.message.reply_to_message
@@ -41,7 +41,7 @@ def authorize(update,context):
@run_async
-def unauthorize(update,context):
+def unauthorize(update, context):
reply_message = None
message_ = None
reply_message = update.message.reply_to_message
@@ -71,7 +71,7 @@ def unauthorize(update,context):
@run_async
-def addSudo(update,context):
+def addSudo(update, context):
reply_message = None
message_ = None
reply_message = update.message.reply_to_message
@@ -96,7 +96,7 @@ def addSudo(update,context):
@run_async
-def removeSudo(update,context):
+def removeSudo(update, context):
reply_message = None
message_ = None
reply_message = update.message.reply_to_message
@@ -120,7 +120,7 @@ def removeSudo(update,context):
@run_async
-def sendAuthChats(update,context):
+def sendAuthChats(update, context):
user = sudo = ''
user += '\n'.join(str(id) for id in AUTHORIZED_CHATS)
sudo += '\n'.join(str(id) for id in SUDO_USERS)
diff --git a/bot/modules/clone.py b/bot/modules/clone.py
index 5fc899235f4..cc4126d9ce2 100644
--- a/bot/modules/clone.py
+++ b/bot/modules/clone.py
@@ -8,8 +8,8 @@
@new_thread
-def cloneNode(update,context):
- args = update.message.text.split(" ",maxsplit=1)
+def cloneNode(update, context):
+ args = update.message.text.split(" ", maxsplit=1)
if update.message.from_user.username:
uname = f"@{update.message.from_user.username}"
else:
@@ -18,16 +18,16 @@ def cloneNode(update,context):
cc = f'\n\ncc: {uname}'
if len(args) > 1:
link = args[1]
- msg = sendMessage(f"Cloning: {link}
",context.bot,update)
+ msg = sendMessage(f"Cloning: {link}
", context.bot, update)
gd = GoogleDriveHelper()
result, button = gd.clone(link)
deleteMessage(context.bot,msg)
if button == "":
- sendMessage(result,context.bot,update)
+ sendMessage(result, context.bot, update)
else:
- sendMarkup(result + cc,context.bot,update,button)
+ sendMarkup(result + cc, context.bot, update, button)
else:
- sendMessage("Provide G-Drive Shareable Link to Clone.",context.bot,update)
+ sendMessage("Provide G-Drive Shareable Link to Clone.", context.bot, update)
-clone_handler = CommandHandler(BotCommands.CloneCommand,cloneNode,filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
+clone_handler = CommandHandler(BotCommands.CloneCommand, cloneNode, filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
dispatcher.add_handler(clone_handler)
diff --git a/bot/modules/count.py b/bot/modules/count.py
index d5d11a6380d..8782c662e57 100644
--- a/bot/modules/count.py
+++ b/bot/modules/count.py
@@ -5,18 +5,19 @@
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot import dispatcher
+
@run_async
-def countNode(update,context):
- args = update.message.text.split(" ",maxsplit=1)
+def countNode(update, context):
+ args = update.message.text.split(" ", maxsplit=1)
if len(args) > 1:
link = args[1]
- msg = sendMessage(f"Counting: {link}
",context.bot,update)
+ msg = sendMessage(f"Counting: {link}
", context.bot, update)
gd = GoogleDriveHelper()
result = gd.count(link)
- deleteMessage(context.bot,msg)
- sendMessage(result,context.bot,update)
+ deleteMessage(context.bot, msg)
+ sendMessage(result, context.bot, update)
else:
- sendMessage("Provide G-Drive Shareable Link to Count.",context.bot,update)
+ sendMessage("Provide G-Drive Shareable Link to Count.", context.bot, update)
-count_handler = CommandHandler(BotCommands.CountCommand,countNode,filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
+count_handler = CommandHandler(BotCommands.CountCommand, countNode, filters=CustomFilters.authorized_chat | CustomFilters.authorized_user)
dispatcher.add_handler(count_handler)
diff --git a/bot/modules/list.py b/bot/modules/list.py
index 30266f7faaa..1cba9f85d66 100644
--- a/bot/modules/list.py
+++ b/bot/modules/list.py
@@ -7,7 +7,7 @@
from bot.helper.telegram_helper.bot_commands import BotCommands
@run_async
-def list_drive(update,context):
+def list_drive(update, context):
try:
search = update.message.text.split(' ',maxsplit=1)[1]
LOGGER.info(f"Searching: {search}")
diff --git a/bot/modules/mirror_status.py b/bot/modules/mirror_status.py
index e4ae32494be..d18c19dd864 100644
--- a/bot/modules/mirror_status.py
+++ b/bot/modules/mirror_status.py
@@ -8,8 +8,9 @@
from bot.helper.telegram_helper.bot_commands import BotCommands
import threading
+
@run_async
-def mirror_status(update,context):
+def mirror_status(update, context):
message = get_readable_message()
if len(message) == 0:
message = "No active downloads"
@@ -21,8 +22,8 @@ def mirror_status(update,context):
if index in status_reply_dict.keys():
deleteMessage(bot, status_reply_dict[index])
del status_reply_dict[index]
- sendStatusMessage(update,context.bot)
- deleteMessage(context.bot,update.message)
+ sendStatusMessage(update, context.bot)
+ deleteMessage(context.bot, update.message)
mirror_status_handler = CommandHandler(BotCommands.StatusCommand, mirror_status,
diff --git a/bot/modules/stickers.py b/bot/modules/stickers.py
index 442a4f0a03a..76cf9304829 100644
--- a/bot/modules/stickers.py
+++ b/bot/modules/stickers.py
@@ -329,21 +329,6 @@ def kang(update: Update, context: CallbackContext):
os.remove("kangsticker.tgs")
-@run_async
-def delsticker(update, context):
- msg = update.effective_message
- if msg.reply_to_message and msg.reply_to_message.sticker:
- file_id = msg.reply_to_message.sticker.file_id
- context.bot.delete_sticker_from_set(file_id)
- msg.reply_text(
- "Deleted!"
- )
- else:
- update.effective_message.reply_text(
- "Please reply to sticker message to del sticker"
- )
-
-
def makepack_internal(
update,
context,
@@ -412,6 +397,21 @@ def makepack_internal(
"Failed to create sticker pack. Possibly due to blek mejik.")
+@run_async
+def delsticker(update, context):
+ msg = update.effective_message
+ if msg.reply_to_message and msg.reply_to_message.sticker:
+ file_id = msg.reply_to_message.sticker.file_id
+ context.bot.delete_sticker_from_set(file_id)
+ msg.reply_text(
+ "Sticker deleted!"
+ )
+ else:
+ update.effective_message.reply_text(
+ "Please reply to sticker message to del sticker"
+ )
+
+
@run_async
def stickhelp(update, context):
help_string = '''