Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spyderzz committed Dec 22, 2019
1 parent 63537c3 commit f80c3b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
7 changes: 3 additions & 4 deletions userbot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
PM_AUTO_BAN = sb(os.environ.get("PM_AUTO_BAN", "False"))

# Heroku Credentials for updater.
HEROKU_MEMEZ = sb(os.environ.get("HEROKU_MEMEZ", "False"))
HEROKU_APPNAME = os.environ.get("HEROKU_APPNAME", None)
HEROKU_APIKEY = os.environ.get("HEROKU_APIKEY", None)

Expand Down Expand Up @@ -158,10 +157,10 @@
# 'bot' variable
if STRING_SESSION:
# pylint: disable=invalid-name
bot = TelegramClient(StringSession(STRING_SESSION), API_KEY, API_HASH)
bot = TelegramClient(StringSession(STRING_SESSION), API_KEY, API_HASH, auto_reconnect=False, lang_code='en')
else:
# pylint: disable=invalid-name
bot = TelegramClient("userbot", API_KEY, API_HASH)
bot = TelegramClient("userbot", API_KEY, API_HASH, auto_reconnect=False, lang_code='en')


async def check_botlog_chatid():
Expand Down Expand Up @@ -204,4 +203,4 @@ async def check_botlog_chatid():
LASTMSG = {}
CMD_HELP = {}
ISAFK = False
AFKREASON = None
AFKREASON = None
9 changes: 4 additions & 5 deletions userbot/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@
LOGS.info("You are running Paperplane Extended [v5.0]")

LOGS.info(
"Congratulations, your userbot is now running !! Test it by typing .alive in any chat."
"If you need assistance, head to https://t.me/PaperplaneExtendedChat")
"Congratulations, your userbot is now running !!"
"Test it by typing .alive in any chat.")

if len(argv) not in (1, 3, 4):
bot.disconnect()
else:
bot.loop.run_until_complete(bot.disconnected)
if bot.reconnect:
args = [sys.executable, "-m", "userbot"]
os.execle(sys.executable, *args, os.environ)
args = [sys.executable, "-m", "userbot"]
os.execle(sys.executable, *args, os.environ)
8 changes: 4 additions & 4 deletions userbot/modules/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import time
from pySmartDL import SmartDL
from telethon import events
from apiclient.discovery import build
from apiclient.http import MediaFileUpload
from apiclient.errors import ResumableUploadError
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
from googleapiclient.errors import ResumableUploadError
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.file import Storage
from oauth2client import file, client, tools
Expand Down Expand Up @@ -454,4 +454,4 @@ async def gdrive_search(http, search_query):
\nUsage: Looks for files and folders in your Google Drive.\
\n\n.ggd <path_to_folder_in_server>\
\nUsage: Uploads all the files in the directory to a folder in Google Drive."
})
})

0 comments on commit f80c3b9

Please sign in to comment.