Skip to content

Commit

Permalink
Happy Birthday to me !! [31/08/2019]
Browse files Browse the repository at this point in the history
Read Changelog in t.me/PaperplaneExtended

Co-authored-by: Geg Zakaryan <[email protected]>
Co-authored-by: Raphiel Rollerscaperers <[email protected]>
Co-authored-by: Shrimadhav U K <[email protected]>
Co-authored-by: Youssif Shaaban Alsager <[email protected]>
Co-authored-by: Muttahir <[email protected]>
Co-authored-by: Kryptic <[email protected]>
  • Loading branch information
7 people authored Aug 31, 2019
1 parent b8a6ba1 commit 50fff15
Show file tree
Hide file tree
Showing 59 changed files with 2,247 additions and 1,098 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ RUN apk add --no-cache --update \
postgresql \
postgresql-client \
postgresql-dev \
py-lxml \
py-pillow \
py-pip \
py-psycopg2 \
py-requests \
py-sqlalchemy \
py-tz \
py3-lxml \
py3-pillow \
py3-pip \
py3-setuptools \
py3-psycopg2 \
py3-requests \
py3-sqlalchemy \
py3-tz \
py3-aiohttp \
python-dev \
openssl \
Expand All @@ -55,8 +56,6 @@ RUN apk add --no-cache --update \
sudo \
zlib-dev

RUN pip3 install --upgrade pip setuptools

# Copy Python Requirements to /app

RUN sed -e 's;^# \(%wheel.*NOPASSWD.*\);\1;g' -i /etc/sudoers
Expand Down Expand Up @@ -86,6 +85,7 @@ ENV PATH="/home/userbot/bin:$PATH"
#
RUN sudo pip3 install -r requirements.txt
ADD . /home/userbot/userbot
RUN sudo chown -R $(whoami) /usr/lib/python3.7/site-packages
RUN sudo chown -R userbot /home/userbot/userbot
RUN sudo chmod -R 777 /home/userbot/userbot
CMD ["python3","-m","userbot"]
60 changes: 48 additions & 12 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
RAPHIELSCAPE PUBLIC LICENSE
Version 1.b, January 2019
Version 1.c, June 2019

Copyright (C) 2019 Raphielscape Open Source Holding LLC.
Copyright (C) 2019 Raphielscape LLC.
Copyright (C) 2019 Devscapes Open Source Holding GmbH.

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

RAPHIELSCAPE PUBLIC LICENSE
A. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
A-1. DEFINITIONS

0. “This License” refers to version 1.c of the Raphielscape Public License.

1. “Copyright” also means copyright-like laws that apply to other kinds of works.

2. “The Work" refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”.
“Licensees” and “recipients” may be individuals or organizations.

3. To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission,
other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work
or a work “based on” the earlier work.

4. Source Form. The “source form” for a work means the preferred form of the work for making modifications to it.
“Object code” means any non-source form of a work.

The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and
(for an executable work) run the object code and to modify the work, including scripts to control those activities.

The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.

5. "The author" refers to "author" of the code, which is the one that made the particular code which exists inside of
the Corresponding Source.

6. "Owner" refers to any parties which is made the early form of the Corresponding Source.

A-2. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You must give any other recipients of the Work or Derivative Works a copy of this License; and

1. You must cause any modified files to carry prominent notices stating that You changed the files; and

2. You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form of the Work; and
3. Respecting the owner of works that being distributed in any ways
this license, all copyright, patent, trademark, authorships and attribution notices
from the Source form of the Work; and

3. Respecting the author and owner of works that are distributed in any way.

You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction,
Expand All @@ -32,15 +68,15 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

C. REVISED VERSION OF THIS LICENSE

The Raphielscape Open Source Holding LLC. may publish revised and/or new versions of the
The Devscapes Open Source Holding GmbH. may publish revised and/or new versions of the
Raphielscape Public License from time to time. Such new versions will be similar in spirit
to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number and version letter. If the Program specifies
that a certain numbered version of the Raphielscape Public License "or any later version" applies
to it, you have the option of following the terms and conditions either of that numbered version or of
any later version published by the Raphielscape Open Source Holding LLC. If the Program does not specify a
Each version is given a distinguishing version number. If the Program specifies that a
certain numbered version of the Raphielscape Public License "or any later version" applies to it,
you have the option of following the terms and conditions either of that numbered version or of
any later version published by the Devscapes Open Source Holding GmbH. If the Program does not specify a
version number of the Raphielscape Public License, you may choose any version ever published
by the Raphielscape Open Source Holding LLC.
by the Devscapes Open Source Holding GmbH.

END OF LICENSE
END OF LICENSE
37 changes: 26 additions & 11 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,34 @@
"env": {
"API_KEY": {
"description": "Get this value from my.telegram.org.",
"value": ""
"required": true
},
"API_HASH": {
"description": "Get this value from my.telegram.org.",
"value": ""
"required": true
},
"STRING_SESSION": {
"description": "Get this value by running [python3 string_session.py] in Termux or local system.",
"value": ""
"required": true
},
"COUNTRY": {
"description": "Set your Country to be used in the .time and .date commands.",
"required": false
},
"TZ_NUMBER": {
"description": "Change this value in case your country has multiple Time Zones.",
"value": "1",
"required": false
},
"CHROME_DRIVER": {
"description": "ChromeDriver location.",
"value": "/usr/bin/chromedriver"
"description": "ChromeDriver location for selenium based modules.",
"value": "/usr/bin/chromedriver",
"required": false
},
"GOOGLE_CHROME_BIN": {
"description": "Google Chrome (or) Chromium binary location.",
"value": "/usr/bin/chromium-browser"
"description": "Google Chrome (or) Chromium binary location for selenium based modules.",
"value": "/usr/bin/chromium-browser",
"required": false
},
"OPEN_WEATHER_MAP_APPID": {
"description": "Get your own APPID (API key)from https://api.openweathermap.org/data/2.5/weather",
Expand All @@ -43,15 +54,15 @@
"value": "False"
},
"BOTLOG_CHATID": {
"description": "ChatID for the Log group",
"description": "ChatID of the Log group. Set it to '0' if BOTLOG = False",
"value": "0"
},
"CONSOLE_LOGGER_VERBOSE": {
"description": "If you need Verbosity on the Logging",
"description": "If you need verbosity on the console logging",
"value": "False"
},
"PM_AUTO_BAN": {
"description": "PM Auto-Ban Feature Switch",
"description": "PM Auto-Ban Feature Switch. Also known as the 'bleep blop, this is a bot...' module.",
"value": "False"
},
"YOUTUBE_API_KEY": {
Expand Down Expand Up @@ -79,7 +90,7 @@
"value": "./downloads/"
},
"CLEAN_WELCOME": {
"description": "Deletes old welcome messages; when a new person joins, the old message is deleted.",
"description": "When a new person joins, the old welcome message is deleted.",
"value": "True"
},
"G_DRIVE_CLIENT_ID": {
Expand Down Expand Up @@ -110,6 +121,10 @@
"description": "Default profile bio.",
"required": false
},
"ALIVE_NAME": {
"description": "Name to show in .alive message",
"required": false
},
"G_DRIVE_CLIENT_SECRET": {
"description": "Enter Your Client Secret for Google Drive.",
"required": false
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ psycopg2-binary
pybase64>=0.4.0
pylast
pySmartDL
python-barcode
python-dotenv
pytube>=9.5.1
pytz
qrcode
requests>=2.18.4
search-engine-parser
speedtest-cli>=2.0.2
sqlalchemy>=1.2
telethon>=1.9
Expand Down
36 changes: 24 additions & 12 deletions sample_config.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ OPEN_WEATHER_MAP_APPID = ""

#
# Location of ChromeDriver for .carbon module
# Default for Heroku : "/app/.chromedriver/bin/chromedriver"
# Default for Heroku Slugs : "/app/.chromedriver/bin/chromedriver"
#
CHROME_DRIVER= ""
CHROME_DRIVER = ""

#
# Get this value by running python3 string_session.py locally
Expand All @@ -26,28 +26,28 @@ STRING_SESSION = ""

#
# Headless GoogleChrome location for .carbon module
# Default for Heroku : "/app/.apt/usr/bin/google-chrome"
# Default for Heroku Slugs : "/app/.apt/usr/bin/google-chrome"
#
GOOGLE_CHROME_BIN= ""
GOOGLE_CHROME_BIN = ""

#
# OCR Space API Key for .ocr command
# Get from https://ocr.space/ocrapi
#
OCR_SPACE_API_KEY= ""
OCR_SPACE_API_KEY = ""

#
# remove.bg API Key for .rbg command
# Get from https://www.remove.bg/api
#
REM_BG_API_KEY= ""
REM_BG_API_KEY = ""

#
# ChatID for the Log group
# Add a Hypen or a Negative Sign before ID
# This is a integer, Please don't use Strings
#
BOTLOG_CHATID = #-<your id>
BOTLOG_CHATID = # Chat ID should be integer.

#
# Incase you want to turn off logging, put this to false
Expand All @@ -62,19 +62,31 @@ CONSOLE_LOGGER_VERBOSE = False
#
# PM Auto-Ban Feature Switch
#
PM_AUTO_BAN=False
PM_AUTO_BAN = False

#
# Custom Default name for .alive
#
ALIVE_NAME = None

#
# Your Database URL
# Example: 'postgres://userbot:userbot@localhost:5432/userbot'
#
DATABASE_URL= ""
DATABASE_URL = ""

#
# YouTube Data API Key for .yt command
# Get from https://console.cloud.google.com
#
YOUTUBE_API_KEY= ""
YOUTUBE_API_KEY = ""

#
# Country and Time Zone setup for
# .time and .date modules
#
COUNTRY = ""
TZ_NUMBER = # this is an integer.

#
# Google Drive Credentials
Expand All @@ -96,9 +108,9 @@ LASTFM_PASSWORD = "Your last.fm password"

# Bot will add before song name. For last.fm module.
# Example: GitHub: MacTavishAO : Skillet - Feel Invincible
BIO_PREFIX=""
BIO_PREFIX = ""
# default bio message
DEFAULT_BIO=""
DEFAULT_BIO = ""

#
# Report or kick some known spammer bots after
Expand Down
32 changes: 26 additions & 6 deletions userbot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.b (the "License");
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot initialization. """
Expand Down Expand Up @@ -44,10 +44,12 @@

# Check if the config was edited by using the already used variable.
# Basically, its the 'virginity check' for the config file ;)
CONFIG_CHECK = os.environ.get("___________PLOX_______REMOVE_____THIS_____LINE__________", None)
CONFIG_CHECK = os.environ.get(
"___________PLOX_______REMOVE_____THIS_____LINE__________", None)

if CONFIG_CHECK:
LOGS.error("Please remove the line mentioned in the first hashtag from the config.env file")
LOGS.error(
"Please remove the line mentioned in the first hashtag from the config.env file")
quit(1)

# Telegram App KEY and HASH
Expand All @@ -70,7 +72,7 @@
# Console verbose logging
CONSOLE_LOGGER_VERBOSE = sb(
os.environ.get("CONSOLE_LOGGER_VERBOSE", "False")
)
)

# SQL Database URI
DB_URI = os.environ.get("DATABASE_URL", None)
Expand Down Expand Up @@ -100,7 +102,22 @@
# Youtube API key
YOUTUBE_API_KEY = os.environ.get(
"YOUTUBE_API_KEY", None
)
)

# Default .alive name
ALIVE_NAME = os.environ.get(
"ALIVE_NAME", None
)

# Time & Date - Country and Time Zone
COUNTRY = str(os.environ.get(
"COUNTRY", ""
))

TZ_NUMBER = int(os.environ.get(
"TZ_NUMBER", 1
))


# Clean Welcome
CLEAN_WELCOME = sb(os.environ.get(
Expand Down Expand Up @@ -131,7 +148,8 @@
G_DRIVE_CLIENT_SECRET = os.environ.get("G_DRIVE_CLIENT_SECRET", None)
G_DRIVE_AUTH_TOKEN_DATA = os.environ.get("G_DRIVE_AUTH_TOKEN_DATA", None)
GDRIVE_FOLDER_ID = os.environ.get("GDRIVE_FOLDER_ID", None)
TEMP_DOWNLOAD_DIRECTORY = os.environ.get("TMP_DOWNLOAD_DIRECTORY", "./downloads")
TEMP_DOWNLOAD_DIRECTORY = os.environ.get(
"TMP_DOWNLOAD_DIRECTORY", "./downloads")

# 'bot' variable
if STRING_SESSION:
Expand All @@ -149,3 +167,5 @@
LASTMSG = {}
ENABLE_KILLME = True
CMD_HELP = {}
ISAFK = False
AFKREASON = None
Loading

0 comments on commit 50fff15

Please sign in to comment.