Clone repository to /src/imepp-agenda
Install pt_BR.utf8
(or change bot.py
to your locale
)
(This may not be required (wasn't on Raspbian): $ sudo apt install language-pack-pt
)
$ sudo dpkg-reconfigure locales
Set timezone to America/Sao_Paulo
$ sudo timedatectl set-timezone America/Sao_Paulo
$ sudo apt install python3 python3-pip python3-venv
$ sudo adduser imeppagenda
$ sudo su imeppagenda
$ cd
$ git clone <this-repo>
$ cd imepp-agenda
Run virtualenv
$ python3 -m venv venv
$ source venv/bin/activate
(To deactivate virtualenv just run deactivate
)
$ pip install -r requirements.txt
$ bash setup.sh
- Sign-in as
IME++
on Google - Enter [https://console.developers.google.com/apis/credentials](Google API Credentials)
- Download JSON
- Rename to
credentials.json
Link imepp-agenda.service
to /etc/systemd/system
.
$ sudo ln -s /home/imeppagenda/imepp-agenda/imepp-agenda.service /etc/systemd/system/imepp-agenda.service
Enable it to run at boot:
$ sudo systemctl enable imepp-agenda
Get your bot TOKEN
using BotFather.
Create a file .ENV
to store your token
$ echo "export TOKEN=<YOUR_TOKEN_HERE>" > .ENV
Having configured everything, the bot should run as a service
(Almost... You must run as sudo
user first, since the authentication of Google
Calendar must be configured by hand: $ sudo ./run.sh
, and on Telegram type: /events
)
$ sudo systemctl start imepp-agenda