Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
breakdowns authored Jun 2, 2021
1 parent 8efd93f commit f8179c8
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
3 changes: 1 addition & 2 deletions bot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions bot/modules/authorize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions bot/modules/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -18,16 +18,16 @@ def cloneNode(update,context):
cc = f'\n\ncc: {uname}'
if len(args) > 1:
link = args[1]
msg = sendMessage(f"Cloning: <code>{link}</code>",context.bot,update)
msg = sendMessage(f"Cloning: <code>{link}</code>", 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)
15 changes: 8 additions & 7 deletions bot/modules/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: <code>{link}</code>",context.bot,update)
msg = sendMessage(f"Counting: <code>{link}</code>", 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)
2 changes: 1 addition & 1 deletion bot/modules/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
7 changes: 4 additions & 3 deletions bot/modules/mirror_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand Down
30 changes: 15 additions & 15 deletions bot/modules/stickers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = '''
Expand Down

0 comments on commit f8179c8

Please sign in to comment.