A Telegram bot, to force a user to follow your GitHub account before chatting.
This bot will mute the user if not followed. It works with Telegram Auth and GitHub oAuth.
-
Add following variables to the envirenment variables.
-
API_HASH
~ Get it from my.telegram.org -
APP_ID
~ Get it from my.telegram.org -
APP_DOMAIN
~ Your application domain name. eg. https://jainam.me. -
BOT_TOKEN
~ Get it from @BotFather. -
GITHUB_USERNAME
~ Your GitHub username, which you want users to force-follow. -
MONGO_URL
~ MongoDb URL, to save user's github usernames after login via GitHub oAuth2. -
FLASK_SECRET_KEY
~ Make it random value, It will be used to access session cookie while Telegram and GitHub linking. -
GITHUB_OAUTH_CLIENT_ID
~ Your GitHub oAuth credential. Get it from here.Assuming
github-app.herokuapp.com
as my App's endpoint.Add App URL in GitHub app settings. eg.
https://github-app.herokuapp.com/
Add App URL and a callback route to it. eg.
https://github-app.herokuapp.com/login/github/authorize
-
GITHUB_OAUTH_CLIENT_SECRET
~ Your GitHub oAuth credential. Get it from here. -
PORT
~ Leave it blank, as Heroku will assign it.
-
-
Set the same
APP_DOMAIN
in Bot settings.-
Locally
1. Clone it to your local machine.
2. Add environment variables or remove them and use as normal varibales via setting them in
config.py
3. Run both the files
app.py
& ForceHub
via python app.py
and python -m ForceHub
respectively.Any other Platform.
1. Clone this repo or fork it.
2. Set the variables as envirenment variables or in
config.py
.3. Publish it.
Use Freenom for a cool free domain.
Many times, Freenom has many server issues, So you will need to retry after some time.
ForceHub is licensed under GNU Affero General Public License v3 or later.
The GNU General Public License (GNU GPL or simply GPL) is a series of widely-used free software licenses that guarantee end users the freedom to run, study, share, and modify the software.[8] The licenses were originally written by Richard Stallman, founder of the Free Software Foundation (FSF), for the GNU Project, and grant the recipients of a computer program the rights of the Free Software Definition.[9] The GPL series are all copyleft licenses, which means that any derivative work must be distributed under the same or equivalent license terms. This is in distinction to permissive software licenses, of which the BSD licenses and the MIT License are widely used, less restrictive examples. GPL was the first copyleft license for general use.