Skip to content

micalevisk/me-telegram-bot

Repository files navigation

me as Telegram Bot

check Wiki Pages

Development usage

first usage

Get your own Telegram API keys here

cp .env.example .env # and place your API values there

# To authorize this client once and generate the .session file
# follow the prompted instructions
export PIPENV_VENV_IN_PROJECT="enabled"

pipenv install
pipenv run python -B setup.py

# authorize and quit (Ctrl-C)

once the project is set up

export PIPENV_VENV_IN_PROJECT="enabled"

pipenv install
#pipenv shell
pipenv run python start_client.py

## or to restart on file changes (`$ npm i -g nodemon` before)
nodemon --signal SIGHUP -e '.py' ./start_client.py

In case of sqlite3.OperationalError: database is locked error:

fuser me_bot.session
kill -9 <pid>

Deploy to Heroku

Create an app on Heroku and use Heroku Git as deployment method (Deploy tab).

# Remove the first two lines of `.gitignore` file
sed 1,2d -i .gitignore # now your .env and .session files are tracked by Git

git add -A
git commit
git push heroku master