From 813f2174be77207196bc9c074c1efdcb193b5e66 Mon Sep 17 00:00:00 2001 From: Hafitz Setya <71178188+breakdowns@users.noreply.github.com> Date: Mon, 24 May 2021 11:52:54 +0700 Subject: [PATCH] v4.7.7 (#103) - Remove unused import - Added badge Co-authored-by: Tanmoy karmakar <59302188+tk007-git@users.noreply.github.com> --- README.md | 19 +++++++++++++------ bot/__main__.py | 6 ++++-- bot/helper/ext_utils/bot_utils.py | 2 +- bot/helper/ext_utils/db_handler.py | 4 ++-- bot/modules/speedtest.py | 4 ++-- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index fc9fb2e..017920d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,18 @@ [![Slam](https://telegra.ph/file/db03910496f06094f1f7a.jpg)](https://youtu.be/Pk_TthHfLeE) # Slam Mirror Bot -This is a Telegram bot writen in Python for mirroring files on the Internet to our beloved Google Drive. +![GitHub Repo stars](https://img.shields.io/github/stars/breakdowns/slam-mirrorbot?color=blue&style=flat) +![GitHub forks](https://img.shields.io/github/forks/breakdowns/slam-mirrorbot?color=green&style=flat) +![GitHub issues](https://img.shields.io/github/issues/breakdowns/slam-mirrorbot) +![GitHub closed issues](https://img.shields.io/github/issues-closed/breakdowns/slam-mirrorbot) +![GitHub pull requests](https://img.shields.io/github/issues-pr/breakdowns/slam-mirrorbot) +![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/breakdowns/slam-mirrorbot) +![GitHub contributors](https://img.shields.io/github/contributors/breakdowns/slam-mirrorbot?style=flat) +![GitHub repo size](https://img.shields.io/github/repo-size/breakdowns/slam-mirrorbot?color=red) +![GitHub commit activity](https://img.shields.io/github/commit-activity/m/breakdowns/slam-mirrorbot) +[![Slam Mirror Support](https://img.shields.io/badge/slam%20mirror%20bot-support%20group-blue)](https://t.me/SlamMirrorSupport) + +**Slam Mirror Bot** is a Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive. # Features supported: @@ -169,7 +180,7 @@ sudo docker run mirrorbot ## Deploying on Heroku -- Fork this repo then upload **token.pickle** to your forks +- Give stars and Fork this repo then upload **token.pickle** to your forks - Hit the **DEPLOY TO HEROKU** button and follow the further instructions in the screen **NOTE**: If you didn't upload **token.pickle**, uploading will not work. How to generate **token.pickle**? [Read here](https://github.com/breakdowns/slam-mirrorbot#getting-google-oauth-api-credential-file) @@ -178,7 +189,6 @@ sudo docker run mirrorbot ## Deploying on Heroku with heroku-cli and Goorm IDE

- # Using Service Accounts for uploading to avoid user rate limit For Service Account to work, you must set **USE_SERVICE_ACCOUNTS=**"True" in config file or environment variables, Many thanks to [AutoRClone](https://github.com/xyou365/AutoRclone) for the scripts. @@ -215,9 +225,6 @@ machine host login username password my_youtube_password ``` Where host is the name of extractor (eg. Youtube, Twitch). Multiple accounts of different hosts can be added each separated by a new line. -# Support Group -

- # Credits Thanks to: diff --git a/bot/__main__.py b/bot/__main__.py index 82ddcf9..2b8f47e 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -1,6 +1,7 @@ import shutil, psutil import signal import pickle + from pyrogram import idle from bot import app from os import execl, kill, path, remove @@ -8,7 +9,8 @@ from sys import executable from datetime import datetime import pytz import time -from telegram import ParseMode, BotCommand, InlineKeyboardMarkup + +from telegram import ParseMode, BotCommand from telegram.ext import CommandHandler, run_async from bot import dispatcher, updater, botStartTime, IMAGE_URL from bot.helper.ext_utils import fs_utils @@ -37,7 +39,7 @@ def stats(update, context): disk = psutil.disk_usage('/').percent stats = f'Bot Uptime: {currentTime}\n' \ f'Start Time: {current}\n' \ - f'Total disk space: {total}\n' \ + f'Total Disk Space: {total}\n' \ f'Used: {used} ' \ f'Free: {free}\n\n' \ f'📊Data Usage📊\nUpload: {sent}\n' \ diff --git a/bot/helper/ext_utils/bot_utils.py b/bot/helper/ext_utils/bot_utils.py index 4bc412b..d26225a 100644 --- a/bot/helper/ext_utils/bot_utils.py +++ b/bot/helper/ext_utils/bot_utils.py @@ -101,7 +101,7 @@ def get_readable_message(): msg += f"\nDownloaded: {get_readable_file_size(download.processed_bytes())} of {download.size()}" else: msg += f"\nUploaded: {get_readable_file_size(download.processed_bytes())} of {download.size()}" - msg += f"\nSpeed: {download.speed()} | ETA: {download.eta()} " + msg += f"\nSpeed: {download.speed()}\nETA: {download.eta()} " # if hasattr(download, 'is_torrent'): try: msg += f"\nSeeders: {download.aria_download().num_seeders}" \ diff --git a/bot/helper/ext_utils/db_handler.py b/bot/helper/ext_utils/db_handler.py index 7e7891f..a4c30e8 100644 --- a/bot/helper/ext_utils/db_handler.py +++ b/bot/helper/ext_utils/db_handler.py @@ -55,7 +55,7 @@ class DbManger: self.conn.commit() self.disconnect() SUDO_USERS.add(chat_id) - return 'Successfully promoted as sudo' + return 'Successfully promoted as Sudo' else: sql = 'INSERT INTO users VALUES ({},TRUE);'.format(chat_id) self.cur.execute(sql) @@ -63,7 +63,7 @@ class DbManger: self.disconnect() AUTHORIZED_CHATS.add(chat_id) SUDO_USERS.add(chat_id) - return 'Successfully Authorized and promoted as sudo' + return 'Successfully Authorized and promoted as Sudo' def db_rmsudo(self,chat_id: int): self.connect() diff --git a/bot/modules/speedtest.py b/bot/modules/speedtest.py index 7ab1515..dc6d274 100644 --- a/bot/modules/speedtest.py +++ b/bot/modules/speedtest.py @@ -2,8 +2,8 @@ from speedtest import Speedtest from bot.helper.telegram_helper.filters import CustomFilters from bot import dispatcher, AUTHORIZED_CHATS from bot.helper.telegram_helper.bot_commands import BotCommands -from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup, ParseMode -from telegram.ext import CallbackContext, Filters, run_async, CommandHandler +from telegram import Update, ParseMode +from telegram.ext import Filters, run_async, CommandHandler @run_async