Skip to content

Commit

Permalink
Merge branch 'MaxxRider:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
NinjaTG committed Jun 10, 2021
2 parents 12a0cb0 + c18bbee commit 756fd4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions tobrot/plugins/call_back_button_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ async def button(bot, update: CallbackQuery):
"_config.yml",
"COPYING",
"Dockerfile",
"extract",
"Procfile",
".heroku",
".profile.d",
Expand Down
10 changes: 6 additions & 4 deletions tobrot/plugins/choose_rclone_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
# -*- coding: utf-8 -*-
# (c) xiaoqi-beta | gautamajay52

import configparser # buildin package
import logging
import os
import re
from configparser import ConfigParser

import pyrogram.types as pyrogram
from pyrogram.types import CallbackQuery
from tobrot import LOGGER, OWNER_ID

config = configparser.ConfigParser()


async def rclone_command_f(client, message):
"""/rclone command"""
LOGGER.info(
f"rclone command from chatid:{message.chat.id}, userid:{message.from_user.id}"
)
if message.from_user.id == OWNER_ID and message.chat.type == "private":
config = ConfigParser()
config.read("rclone_bak.conf")
sections = list(config.sections())
inline_keyboard = []
Expand All @@ -31,6 +30,7 @@ async def rclone_command_f(client, message):
)
]
inline_keyboard.append(ikeyboard)
config = ConfigParser()
config.read("rclone.conf")
section = config.sections()[0]
msg_text = f"""Default section of rclone config is: **{section}**\n\n
Expand All @@ -54,6 +54,7 @@ async def rclone_command_f(client, message):
async def rclone_button_callback(bot, update: CallbackQuery):
"""rclone button callback"""
if update.data == "rcloneCancel":
config = ConfigParser()
config.read("rclone.conf")
section = config.sections()[0]
await update.message.edit_text(
Expand All @@ -65,8 +66,9 @@ async def rclone_button_callback(bot, update: CallbackQuery):
else:
section = update.data.split("_", maxsplit=1)[1]
with open("rclone.conf", "w", newline="\n", encoding="utf-8") as f:
config = ConfigParser()
config.read("rclone_bak.conf")
temp = configparser.ConfigParser()
temp = ConfigParser()
temp[section] = config[section]
temp.write(f)
await update.message.edit_text(
Expand Down
2 changes: 1 addition & 1 deletion tobrot/plugins/incoming_message_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ async def incoming_youtube_dl_f(client, message):
await i_m_sefg.edit("🐈 𝐎𝐩𝐩𝐬 𝐑𝐞𝐩𝐥𝐲 𝐰𝐢𝐭𝐡 𝐘𝐨𝐮𝐓𝐮𝐛𝐞 𝐕𝐢𝐝𝐞𝐨𝐬 𝐋𝐢𝐧𝐤.")
return
if dl_url is not None:
await i_m_sefg.edit_text("extracting links")
await i_m_sefg.edit_text("𝑬𝒙𝒕𝒓𝒂𝒄𝒕𝒊𝒏𝒈 𝑳𝒊𝒏𝒌𝒔..")
# create an unique directory
user_working_dir = os.path.join(DOWNLOAD_LOCATION, str(current_user_id))
# create download directory, if not exist
Expand Down
2 changes: 1 addition & 1 deletion tobrot/plugins/new_join_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async def new_join_f(client, message):
chat_type = message.chat.type
if chat_type != "private":
await message.reply_text(
"""<b>🙋🏻‍♂️ Hello dear!\n\n Welcome to Leech Group</b>\n\n<b>Current CHAT ID: <code>{message.chat.id}</code>""",
f"""<b>🙋🏻‍♂️ Hello dear!\n\n Welcome to Leech Group</b>\n\n<b>Current CHAT ID: <code>{message.chat.id}</code>""",
parse_mode="html",
reply_markup=InlineKeyboardMarkup(
[
Expand Down

0 comments on commit 756fd4d

Please sign in to comment.