The Bot is hosted on Heroku and has been tested with Python v3.9.7
.
J4NN0 BOT main features:
- Store, delete, and view items on your private list using simple chat commands.
- Set a timed reminder — the bot will notify you with your custom message when the time is up.
Check it out on telegram: @J4NN0_Bot
The bot uses a simple SQLite database consisting of a single table: REMINDERS
Table Structure:
CHATID
: Unique chat ID associated with the user.USRNAME
: Telegram username of the user.ITEM
: The item the user has added to their personal list.
Whenever a user adds or removes items from their list, the changes are immediately reflected in the database (insertions or deletions from the REMINDERS
table).
To inspect or manage the database, you can use DB Browser for SQLite to easily manage CRUD operations in SQLite databases via a graphical interface.
A local .sqlite
database isn’t ideal for a finalized product. That said, SQLite was intentionally chosen for this side project to keep the setup simple and lightweight. It requires no external services, making it easy for anyone to run the bot locally or on platforms like Heroku without extra configuration.
-
⭕ Developer
/about
: to see info about developer
-
📝 List
/addtolist <item>
: to add one or several items to your personal list./rmfromlist <item>
: to remove one or several items from your personal list./show_list
: it shows all items in your personal list./clear_list
: to delete all items from your personal list.
-
🔀 Random value
/random <number>
: it will return a random number between 0 and .
-
⏰ Alarm
/timer <seconds>
: to set a timer and wait for your message.
-
🤖 Info about bot
/help
: to have info about all commands.
-
Register on Heroku.
-
Download and install Heroku CLI and git.
-
Create a project folder and put inside it the following files
bot.py Procfile runtime.txt requirements.txt
You can also have a
app.json
schema in order to declare environment variables, add-ons, and other information required to run an app on Heroku. More info here. -
Put inside
Procfile
worker: python script.py
-
Put the python version you want to use in
runtime.txt
.For instance, if you want to use Python
v3.6.6
just put inside the file:python-3.6.6
-
Specify explicit dependencies versions inside
requirements.txt
.For instance, I'm using python-telegram-bot API. So my file
requirements.txt
will look likepython-telegram-bot==8.1.1
To update this file, you can use the
pip freeze
command in your active virtual environment:pip freeze > requirements.txt
More info here.
-
If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key
heroku login
-
Create git repository
git init
or clone this repo
git clone https://github.com/J4NN0/j4nn0-b0t.git
-
Create heroku app
heroku create
-
Push your code (or deploy changes) into heroku app
git add . git commit -m 'message' git push heroku master
-
Run your worker
heroku ps:scale worker=1
-
Check logs with and enjoy your bot
heroku logs --tail
- Your first bot
- Python Telegram Bot
- Code snippets
- Officilia Telegram Bot docs
- Getting Started on Heroku with Python
- Sqlite3