Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
japarmar authored Feb 24, 2020
1 parent a16224a commit 3e9939c
Show file tree
Hide file tree
Showing 8 changed files with 237 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CheckUserBotWorking:
script:
- echo "Nothing"
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
userbot: python -m userbot
112 changes: 112 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"name": "X-tra Telegram",
"description": "Userbot created by a SNAPDRAGON and custom fork by ANUBIS\n\n join https://t.me/X_tra_tele_support for any problems or support",
"logo": "https://telegra.ph/file/1be6c59f53fef57b5745b.jpg",
"keywords": [
"telegram",
"userbot",
"plugin",
"modular",
"productivity"
],
"repository": "https://github.com/Dark-Princ3/X-tra-Telegram/",
"website": "#TODO",
"success_url": "#TODO",
"env": {
"ENV": {
"description": "Setting this to ANYTHING will enable heroku.",
"value": "ANYTHING"
},
"TEMP_DOWNLOAD_DIRECTORY": {
"description": "Where downloaded files will go.",
"value": "./userbot/DOWNLOADS/",
"required": false
},
"APP_ID": {
"description": "Get this value from my.telegram.org! Please do not steal",
"value": ""
},
"API_HASH": {
"description": "Get this value from my.telegram.org! Please do not steal",
"value": ""
},
"STRING_SESSION": {
"description": "Get this value by running python3 telesetup.py locally",
"value": ""
},
"GITHUB_ACCESS_TOKEN": {
"description": "Your Github Access Token for gitcommit plugin.Google 'Github access token' to find.",
"value": "",
"required": false
},
"GIT_REPO_NAME": {
"description": "Your repo name Example: Total-Noob-69/X-Tra-Telegram, but GITHUB_ACCESS_TOKEN must be setup first.",
"value": "",
"required": false
},
"LYDIA_API_KEY": {
"description": "Needed for Lydia AI. Follow https://telegra.ph/Lydia-09-05 to get your API.",
"value": "",
"required": false
},
"HEROKU_API_KEY": {
"description": "Go to https://dashboard.heroku.com/account, scroll down and press Reveal API.Required for updater to work.",
"value": "",
"required": false
},
"HEROKU_APP_NAME": {
"description": "The Value of App Name you filled in right on top.Required for updater to work.",
"value": "",
"required": false
},
"TG_BOT_TOKEN_BF_HER": {
"description": "Needed for inline buttons maker. Make a bot at [BotFather](http://telegram.dog/BotFather) and get the token of your bot.Worth it. Get it.",
"value": "",
"required": false
},
"CHROME_BIN": {
"description": "For Carbon.py. Leave as it is. ",
"value": "/app/.apt/usr/bin/google-chrome",
"required": false
},
"CHROME_DRIVER": {
"description": "For Carbon.py. Leave as it is. ",
"value": "/app/.chromedriver/bin/chromedriver",
"required": false
},
"TG_BOT_USER_NAME_BF_HER": {
"description": "Needed for inline buttons maker. Make a bot at [BotFather](http://telegram.dog/BotFather) and get the username of your bot",
"value": "",
"required": false
},
"DOWNLOAD_PFP_URL_CLOCK": {
"description": "Needed for autopic module. A url that is a preview link of your Profile Pic",
"value": "",
"required": false
},
"TZ": {
"description": "Required for Correct Time on autopic",
"value": "",
"required": false
}
},
"addons": [{
"plan": "heroku-postgresql",
"options": {
"version": "9.5"
}
}],
"buildpacks": [{
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest"
},{
"url":"https://github.com/amivin/aria2-heroku.git"
},{
"url":"https://github.com/heroku/heroku-buildpack-google-chrome"
},{
"url":"https://github.com/heroku/heroku-buildpack-chromedriver"
},{
"url": "https://github.com/opendoor-labs/heroku-buildpack-p7zip"
},{
"url": "heroku/python"
}]
}
39 changes: 39 additions & 0 deletions heroku_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import os

class Var(object):
APP_ID = int(os.environ.get("APP_ID", 6))
# 6 is a placeholder
API_HASH = os.environ.get("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e")
STRING_SESSION = os.environ.get("STRING_SESSION", None)
DB_URI = os.environ.get("DATABASE_URL", None)
TEMP_DOWNLOAD_DIRECTORY = os.environ.get("TEMP_DOWNLOAD_DIRECTORY", None)
LOGGER = True
GITHUB_ACCESS_TOKEN = os.environ.get("GITHUB_ACCESS_TOKEN", None)
GIT_REPO_NAME = os.environ.get("GIT_REPO_NAME", None)
# Here for later purposes
SUDO_USERS = os.environ.get("SUDO_USERS", "719877937")
LYDIA_API_KEY = os.environ.get("LYDIA_API_KEY", None)
HEROKU_API_KEY = os.environ.get("HEROKU_API_KEY", None)
HEROKU_APP_NAME = os.environ.get("HEROKU_APP_NAME", None)
TG_BOT_TOKEN_BF_HER = os.environ.get("TG_BOT_TOKEN_BF_HER", None)
TG_BOT_USER_NAME_BF_HER = os.environ.get("TG_BOT_USER_NAME_BF_HER", None)
DOWNLOAD_PFP_URL_CLOCK = os.environ.get("DOWNLOAD_PFP_URL_CLOCK", None)
G_DRIVE_CLIENT_ID = os.environ.get("G_DRIVE_CLIENT_ID", None)
G_DRIVE_CLIENT_SECRET = os.environ.get("G_DRIVE_CLIENT_SECRET", None)
GDRIVE_FOLDER_ID = os.environ.get("GDRIVE_FOLDER_ID", "root")
AUTH_TOKEN_DATA = os.environ.get("AUTH_TOKEN_DATA", None)
if AUTH_TOKEN_DATA != None:
os.makedirs(TEMP_DOWNLOAD_DIRECTORY)
t_file = open(TEMP_DOWNLOAD_DIRECTORY+"auth_token.txt","w")
t_file.write(AUTH_TOKEN_DATA)
t_file.close()
PRIVATE_GROUP_ID = os.environ.get("PRIVATE_GROUP_ID", None)
if PRIVATE_GROUP_ID != None:
try:
PRIVATE_GROUP_ID = int(PRIVATE_GROUP_ID)
except ValueError:
raise ValueError("Invalid Private Group ID. Make sure your ID is starts with -100 and make sure that it is only numbers.")

class Development(Var):
LOGGER = True
# Here for later purposes
52 changes: 52 additions & 0 deletions requirements-startup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Pillow>=5.3.0
PyGithub
aiofiles
aiohttp
aria2p
async_generator
beautifulsoup4
bs4
bwb==3.0.0
cfscrape
coffeehouse
cowpy
cryptg
dnspython
emoji
gTTS-token>=1.1.3
gTTS>=2.0.1
gitpython
google-api-python-client
google-auth-oauthlib
google_images_download>=2.7.1
googletrans>=2.4.0
gsearch
hachoir
heroku3
httplib2
humanize
lxml
oauth2client
psycopg2
psycopg2-binary
pySmartDL
pybase64>=0.4.0
pyfiglet
pylast
pymongo
python-barcode
python-dotenv
python-magic
pytube
pytz
qrcode
regex
requests>=2.18.4
search-engine-parser>=0.4.2
selenium
speedtest-cli>=2.0.2
sqlalchemy>=1.2
telegraph
urbandict>=0.5
wikipedia>=1.4.0
youtube-dl
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
telethon>=1.10.3
-r requirements-startup.txt
18 changes: 18 additions & 0 deletions telesetup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python3
# (c) https://t.me/TelethonChat/37677
# This Source Code Form is subject to the terms of the GNU
# General Public License, v.3.0. If a copy of the GPL was not distributed with this
# file, You can obtain one at https://www.gnu.org/licenses/gpl-3.0.en.html.

from telethon.sync import TelegramClient
from telethon.sessions import StringSession

print("""Please go-to my.telegram.org
Login using your Telegram account
Click on API Development Tools
Create a new application, by entering the required details""")
APP_ID = int(input("Enter APP ID here: "))
API_HASH = input("Enter API HASH here: ")

with TelegramClient(StringSession(), APP_ID, API_HASH) as client:
print(client.session.save())
10 changes: 10 additions & 0 deletions var.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os

ENV = bool(os.environ.get("ENV", False))
if ENV:
from heroku_config import Var as Config
else:
from local_config import Development as Config


Var = Config

0 comments on commit 3e9939c

Please sign in to comment.