├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── CODE_OF_CONDUCT ├── Dockerfile ├── LICENSE ├── Procfile.txt ├── README.md ├── app.json ├── bin ├── install.sh └── sh ├── generate_session_file.py ├── heroku.yml ├── requirements.txt ├── sample_config.env ├── string_session.py ├── termux_install.sh ├── userbot ├── .bin │ └── readme ├── __init__.py ├── __main__.py ├── events.py ├── google_images_download.py ├── modules │ ├── __init__.py │ ├── admin.py │ ├── afk.py │ ├── android.py │ ├── anti_spambot.py │ ├── aria.py │ ├── chat.py │ ├── direct_links.py │ ├── dogbin.py │ ├── evaluators.py │ ├── filter.py │ ├── gdrive.py │ ├── hash.py │ ├── help.py │ ├── lastfm.py │ ├── locks.py │ ├── lydia.py │ ├── memes.py │ ├── misc.py │ ├── notes.py │ ├── ocr.py │ ├── pmpermit.py │ ├── profile.py │ ├── purge.py │ ├── qrcode.py │ ├── remove_bg.py │ ├── reverse.py │ ├── scrapers.py │ ├── screencapture.py │ ├── sed.py │ ├── snips.py │ ├── spam.py │ ├── sql_helper │ │ ├── .DS_Store │ │ ├── __init__.py │ │ ├── filter_sql.py │ │ ├── globals.py │ │ ├── gmute_sql.py │ │ ├── keep_read_sql.py │ │ ├── notes_sql.py │ │ ├── pm_permit_sql.py │ │ ├── snips_sql.py │ │ ├── spam_mute_sql.py │ │ └── welcome_sql.py │ ├── stickers.py │ ├── system_stats.py │ ├── time.py │ ├── updater.py │ ├── upload_download.py │ ├── weather.py │ ├── welcomes.py │ ├── whois.py │ └── www.py └── prettyjson.py └── windows_startup_script.py /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Python Version** 24 | Provide exact python version used 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Additional context** 14 | Add any other context or screenshots about the feature request here. 15 | 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | config.env 2 | __pycache__/* 3 | userbot.db 4 | userbot.session 5 | userbot.session-journal 6 | userbot/__pycache__/* 7 | userbot/modules/__pycache__/* 8 | userbot/modules/sql_helper/__pycache__/* 9 | .progress 10 | .vscode/* 11 | bin/* 12 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | All participants of RaphielGang are expected to abide by our Code of Conduct, 4 | both online and during in-person events that are hosted and/or associated with RaphielGang. 5 | 6 | 7 | ### The Pledge 8 | 9 | In the interest of fostering an open and welcoming environment, we pledge to make participation 10 | in our project and our community a harassment-free experience for everyone, regardless of age, 11 | body size, disability, ethnicity, gender identity and expression, level of experience, 12 | nationality, personal appearance, race, religion, or sexual identity and orientation. 13 | 14 | 15 | ### The Standards 16 | 17 | Examples of behaviour that contributes to creating a positive environment include: 18 | 19 | * **Be welcoming**: We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability. 20 | * **Be considerate**: Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we're a world-wide community, so you might not be communicating in someone else's primary language. 21 | * **Be respectful**: Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It’s important to remember that a community where people feel uncomfortable or threatened is not a productive one. 22 | * **Gracefully accepting constructive criticism**: Not everyone are perfect, you can get some critism of your works from us, but it's not means that we don't accepting your contribution, we just want you to fixing it and making it better. 23 | * **Referring to people by their preferred pronouns/words**, but we do not have standardized gender-neutral pronouns/words, so your milleage may vary. 24 | * **Do not attack somebody because you have a different opinion** All opinions are accepted as long as they are reasonable, and everyone have right to shouting their opinion. 25 | * **Just chill :D** 26 | * **Don't forget, nobody is perfect, mistakes can be made** 27 | * **Equality is not a privilege, it's a rule!** 28 | 29 | ### Examples of unacceptable behaviour by participants include: 30 | 31 | * **Trolling, insulting/derogatory comments, public or private harassment** 32 | * **Publishing others' private information (Doxing)** such as a physical or electronic address, without explicit permission 33 | * **Not being respectful to reasonable communication boundaries** such as 'leave me alone,' 'go away,' or 'Fuck off.' 34 | * **The usage of sexualised language or imagery and unwelcome sexual attention or advances** 35 | * **Demonstrating the graphics or any other content you know may be considered disturbing** 36 | * **Assuming or promoting any kind of inequality** including but not limited to: age, body size, disability, ethnicity, gender identity and expression, nationality and race, personal appearance, religion, or sexual identity and orientation 37 | * **Drug promotion of any kind** 38 | * **Attacking personal tastes** 39 | * **Other conduct which you know could reasonably be considered inappropriate in a professional setting** 40 | 41 | 42 | ### Enforcement 43 | 44 | Violations of the Code of Conduct may be reported by sending an email to [raphielscape@outlook.com](mailto:raphielscape@outlook.com). 45 | All reports will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. 46 | Further details of specific enforcement policies may be posted separately. 47 | 48 | We hold the right and responsibility to remove comments or other contributions that 49 | are not aligned to this Code of Conduct, or to ban temporarily or permanently any members 50 | for other behaviours that they deem inappropriate, threatening, offensive, or harmful. -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # We're using Alpine Edge 2 | FROM alpine:edge 3 | 4 | # 5 | # We have to uncomment Community repo for some packages 6 | # 7 | RUN sed -e 's;^#http\(.*\)/edge/community;http\1/edge/community;g' -i /etc/apk/repositories 8 | 9 | # 10 | # Installing Packages 11 | # 12 | RUN apk add --no-cache=true --update \ 13 | coreutils \ 14 | bash \ 15 | build-base \ 16 | bzip2-dev \ 17 | curl \ 18 | figlet \ 19 | gcc \ 20 | g++ \ 21 | git \ 22 | sudo \ 23 | aria2 \ 24 | util-linux \ 25 | libevent \ 26 | jpeg-dev \ 27 | libffi-dev \ 28 | libpq \ 29 | libwebp-dev \ 30 | libxml2 \ 31 | libxml2-dev \ 32 | libxslt-dev \ 33 | linux-headers \ 34 | musl \ 35 | neofetch \ 36 | openssl-dev \ 37 | postgresql \ 38 | postgresql-client \ 39 | postgresql-dev \ 40 | openssl \ 41 | pv \ 42 | jq \ 43 | wget \ 44 | freetype \ 45 | freetype-dev \ 46 | python3 \ 47 | python3-dev \ 48 | readline-dev \ 49 | sqlite \ 50 | ffmpeg \ 51 | libjpeg-turbo-dev \ 52 | sqlite-dev \ 53 | libc-dev \ 54 | sudo \ 55 | chromium \ 56 | chromium-chromedriver \ 57 | zlib-dev \ 58 | jpeg 59 | # 60 | 61 | RUN curl https://cli-assets.heroku.com/install.sh 62 | 63 | RUN python3 -m ensurepip \ 64 | && pip3 install --upgrade pip setuptools \ 65 | && rm -r /usr/lib/python*/ensurepip && \ 66 | if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \ 67 | if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \ 68 | rm -r /root/.cache 69 | 70 | 71 | 72 | 73 | # 74 | # Clone repo and prepare working directory 75 | # 76 | 77 | RUN git clone https://github.com/Devp73/Userbot1 /root/userbot 78 | RUN mkdir /root/userbot/.bin 79 | WORKDIR /root/userbot/ 80 | ENV PATH="/root/userbot/.bin:$PATH" 81 | WORKDIR /root/userbot/ 82 | # 83 | # Copies session and config (if it exists) 84 | # 85 | COPY ./sample_config.env ./userbot.session* ./config.env* /root/userbot/ 86 | 87 | # 88 | # Install requirements 89 | # 90 | RUN pip3 install -r requirements.txt 91 | CMD ["python3","-m","userbot"] 92 | 93 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | RAPHIELSCAPE PUBLIC LICENSE 2 | Version 1.c, June 2019 3 | 4 | Copyright (C) 2019 Raphielscape LLC. 5 | Copyright (C) 2019 Devscapes Open Source Holding GmbH. 6 | 7 | Everyone is permitted to copy and distribute verbatim or modified 8 | copies of this license document, and changing it is allowed as long 9 | as the name is changed. 10 | 11 | RAPHIELSCAPE PUBLIC LICENSE 12 | A-1. DEFINITIONS 13 | 14 | 0. “This License” refers to version 1.c of the Raphielscape Public License. 15 | 16 | 1. “Copyright” also means copyright-like laws that apply to other kinds of works. 17 | 18 | 2. “The Work" refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. 19 | “Licensees” and “recipients” may be individuals or organizations. 20 | 21 | 3. To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, 22 | other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work 23 | or a work “based on” the earlier work. 24 | 25 | 4. Source Form. The “source form” for a work means the preferred form of the work for making modifications to it. 26 | “Object code” means any non-source form of a work. 27 | 28 | The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and 29 | (for an executable work) run the object code and to modify the work, including scripts to control those activities. 30 | 31 | The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. 32 | The Corresponding Source for a work in source code form is that same work. 33 | 34 | 5. "The author" refers to "author" of the code, which is the one that made the particular code which exists inside of 35 | the Corresponding Source. 36 | 37 | 6. "Owner" refers to any parties which is made the early form of the Corresponding Source. 38 | 39 | A-2. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 40 | 41 | 0. You must give any other recipients of the Work or Derivative Works a copy of this License; and 42 | 43 | 1. You must cause any modified files to carry prominent notices stating that You changed the files; and 44 | 45 | 2. You must retain, in the Source form of any Derivative Works that You distribute, 46 | this license, all copyright, patent, trademark, authorships and attribution notices 47 | from the Source form of the Work; and 48 | 49 | 3. Respecting the author and owner of works that are distributed in any way. 50 | 51 | You may add Your own copyright statement to Your modifications and may provide 52 | additional or different license terms and conditions for use, reproduction, 53 | or distribution of Your modifications, or for any such Derivative Works as a whole, 54 | provided Your use, reproduction, and distribution of the Work otherwise complies 55 | with the conditions stated in this License. 56 | 57 | B. DISCLAIMER OF WARRANTY 58 | 59 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 60 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 61 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 62 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 63 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 64 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 65 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 66 | OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 67 | 68 | 69 | C. REVISED VERSION OF THIS LICENSE 70 | 71 | The Devscapes Open Source Holding GmbH. may publish revised and/or new versions of the 72 | Raphielscape Public License from time to time. Such new versions will be similar in spirit 73 | to the present version, but may differ in detail to address new problems or concerns. 74 | 75 | Each version is given a distinguishing version number. If the Program specifies that a 76 | certain numbered version of the Raphielscape Public License "or any later version" applies to it, 77 | you have the option of following the terms and conditions either of that numbered version or of 78 | any later version published by the Devscapes Open Source Holding GmbH. If the Program does not specify a 79 | version number of the Raphielscape Public License, you may choose any version ever published 80 | by the Devscapes Open Source Holding GmbH. 81 | 82 | END OF LICENSE 83 | -------------------------------------------------------------------------------- /Procfile.txt: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | worker: Dockerfile 4 | run: 5 | worker: python3 -m userbot 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
How To Host | Updates and Support | Credits | License
6 |7 |
11 |
Huge thanks to everyone who have helped make this userbot awesome!!
13 |14 |
Join our Telegram Channel for update notifications!
16 |Also join our Telegram Support Group for help and support!
17 |18 |
Raphielscape Public License - Version 1.c, June 2019
20 |21 |
For generatingstring sessionyou can use this commands
23 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Telegram User Bot", 3 | "description": "[Paperplane Extended] A modular Telegram userbot running on Python 3.6+ with an sqlalchemy database.", 4 | "logo": "https://i.imgur.com/ATSG4w3.png", 5 | "keywords": [ 6 | "telegram", 7 | "userbot", 8 | "plugin", 9 | "modular", 10 | "productivity" 11 | ], 12 | "repository": "https://github.com/Devp73/Userbot1", 13 | "website": "https://telegra.ph/How-to-host-a-Telegram-Userbot-07-24", 14 | "success_url": "https://t.me/dev_userbot1", 15 | "stack": "container", 16 | "env": { 17 | "API_KEY": { 18 | "description": "Get this value from my.telegram.org.", 19 | "required": true 20 | }, 21 | "API_HASH": { 22 | "description": "Get this value from my.telegram.org.", 23 | "required": true 24 | }, 25 | "STRING_SESSION": { 26 | "description": "Get this value by running [python3 string_session.py] in Termux or local system.", 27 | "required": true 28 | }, 29 | "HEROKU_MEMEZ": { 30 | "description": "This should be True if the userbot is running on a Heroku Dyno.", 31 | "value": "True", 32 | "required": false 33 | }, 34 | "HEROKU_API_KEY": { 35 | "description": "Your Heroku API key, get it from 'https://dashboard.heroku.com/account'", 36 | "value": "", 37 | "required": false 38 | }, 39 | "HEROKU_APP_NAME": { 40 | "description": "Add the Heroku app name here. It helps with userbot updates.", 41 | "required": false 42 | }, 43 | "GITHUB_ACCESS_TOKEN": { 44 | "description": "Your GITHUB_ACCESS_TOKEN, get it from 'https://github.com/settings/tokens'", 45 | "value": "", 46 | "required": false 47 | }, 48 | "GIT_REPO_NAME": { 49 | "description": "Add the GIT_REPO_NAME here. It helps with commit on GitHub.", 50 | "required": false 51 | }, 52 | "UPSTREAM_REPO_URL": { 53 | "description": "In case you maintain a fork, add your repo URL here.", 54 | "value": "https://github.com/Devp73/Userbot1", 55 | "required": false 56 | }, 57 | "GIT__URL": { 58 | "description": "Your repo(forked) visit https://t.me/devkeks/39 to see what to add", 59 | "value": "", 60 | "required": false 61 | }, 62 | "COUNTRY": { 63 | "description": "Set your Country to be used in the .time and .date commands.", 64 | "required": false 65 | }, 66 | "TZ_NUMBER": { 67 | "description": "Change this value in case your country has multiple Time Zones.", 68 | "value": "1", 69 | "required": false 70 | }, 71 | "CHROME_DRIVER": { 72 | "description": "ChromeDriver location for selenium based modules.", 73 | "value": "/usr/bin/chromedriver", 74 | "required": false 75 | }, 76 | "GOOGLE_CHROME_BIN": { 77 | "description": "Google Chrome (or) Chromium binary location for selenium based modules.", 78 | "value": "/usr/bin/chromium-browser", 79 | "required": false 80 | }, 81 | "OPEN_WEATHER_MAP_APPID": { 82 | "description": "Get your own APPID (API key)from https://api.openweathermap.org/data/2.5/weather", 83 | "required": false 84 | }, 85 | "BOTLOG": { 86 | "description": "Incase you want to turn off logging, put this to false", 87 | "value": "False" 88 | }, 89 | "BOTLOG_CHATID": { 90 | "description": "ChatID of the Log group. Set it to '0' if BOTLOG = False and/or if LOGSPAMMER = False.", 91 | "value": "0" 92 | }, 93 | "CONSOLE_LOGGER_VERBOSE": { 94 | "description": "If you need verbosity on the console logging", 95 | "value": "False" 96 | }, 97 | "PM_AUTO_BAN": { 98 | "description": "PM Auto-Ban Feature Switch. Also known as the 'bleep blop, this is a bot...' module.", 99 | "value": "False" 100 | }, 101 | "YOUTUBE_API_KEY": { 102 | "description": "YouTube Data API Key for .yt command. Get from https://console.cloud.google.com", 103 | "required": false 104 | }, 105 | "OCR_SPACE_API_KEY": { 106 | "description": "OCR API Key for .ocr command. Get from https://ocr.space/ocrapi", 107 | "required": false 108 | }, 109 | "REM_BG_API_KEY": { 110 | "description": "API Key for .rbg command. Get from https://www.remove.bg/api", 111 | "required": false 112 | }, 113 | "ANTI_SPAMBOT": { 114 | "description": "Kicks spambots from groups after they join. [Requires admin powers in groups to kick.]", 115 | "value": "False" 116 | }, 117 | "ANTI_SPAMBOT_SHOUT": { 118 | "description": "Report spambots to @admins in groups after they join, just in case when you don't have admin powers to kick that shit yourself.", 119 | "value": "False" 120 | }, 121 | "TMP_DOWNLOAD_DIRECTORY": { 122 | "description": "Download location for many modules (GDrive, .download etc..)", 123 | "value": "./downloads/" 124 | }, 125 | "CLEAN_WELCOME": { 126 | "description": "When a new person joins, the old welcome message is deleted.", 127 | "value": "True" 128 | }, 129 | "G_DRIVE_CLIENT_ID": { 130 | "description": "Enter Your Client ID for Google Drive.", 131 | "required": false 132 | }, 133 | "LASTFM_API": { 134 | "description": "API Key for Last.FM module. [Get one from - https://www.last.fm/api/account/create]", 135 | "required": false 136 | }, 137 | "LASTFM_SECRET": { 138 | "description": "SECRET Key for Last.FM module. [Get one from - https://www.last.fm/api/account/create]", 139 | "required": false 140 | }, 141 | "LASTFM_USERNAME": { 142 | "description": "Last.FM Username", 143 | "required": false 144 | }, 145 | "LASTFM_PASSWORD": { 146 | "description": "Last.FM Password", 147 | "required": false 148 | }, 149 | "BIO_PREFIX": { 150 | "description": "Prefix for Last.FM Module Bio.", 151 | "required": false 152 | }, 153 | "DEFAULT_BIO": { 154 | "description": "Default profile bio.", 155 | "required": false 156 | }, 157 | "ALIVE_NAME": { 158 | "description": "Name to show in .alive message, put username to mention yourself", 159 | "required": false 160 | }, 161 | "G_DRIVE_CLIENT_SECRET": { 162 | "description": "Enter Your Client Secret for Google Drive.", 163 | "required": false 164 | }, 165 | "G_DRIVE_AUTH_TOKEN_DATA": { 166 | "description": "Enter the Google Drive authentication data, as a JSON structure.", 167 | "required": false 168 | }, 169 | "LYDIA_API_KEY": { 170 | "description": "This Module Needs CoffeeHouse API to work. so Join https://telegram.dog/IntellivoidDev and send #activateapi and follow instructions.", 171 | "required": false 172 | }, 173 | "WEATHER_DEFCITY": { 174 | "description": "Set the default city for the userbot's weather module.", 175 | "required": false 176 | }, 177 | "LOGSPAMMER": { 178 | "description": "Set this to True in case you want the error logs to be stored in the userbot log group, instead of spitting out the file in the current chat, requires a valid BOTLOG_CHATID to be set.", 179 | "value": "True" 180 | } 181 | }, 182 | "addons": [ 183 | { 184 | "plan": "heroku-postgresql", 185 | "options": { 186 | "version": "12" 187 | } 188 | } 189 | ],"buildpacks": [{ 190 | "url": "https://github.com/heroku/heroku-buildpack-python.git" 191 | }, { 192 | "url": "https://github.com/heroku/heroku-buildpack-google-chrome" 193 | }, { 194 | "url": "https://github.com/HasibulKabir/heroku-buildpack-rarlab" 195 | },{ 196 | "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" 197 | }, { 198 | "url": "https://github.com/opendoor-labs/heroku-buildpack-p7zip" 199 | }, { 200 | "url": "https://github.com/amivin/aria2-heroku" 201 | }, { 202 | "url": "https://github.com/stevo550/buildpack-slug-cleaner" 203 | }] 204 | } 205 | -------------------------------------------------------------------------------- /bin/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | { 3 | set -e 4 | SUDO='' 5 | if [ "$(id -u)" != "0" ]; then 6 | SUDO='sudo' 7 | echo "This script requires superuser access." 8 | echo "You will be prompted for your password by sudo." 9 | # clear any previous sudo permission 10 | sudo -k 11 | fi 12 | 13 | 14 | # run inside sudo 15 | $SUDO bash <