A personal telegram bot for creating expensify report diretly from an expense PDF.
There are company restrictions on Slack bot, hence Telegram bot.
Intended to be used as a private assistant + due to sensitive information involved in automating this, opting for a safe & secure option. Considering the confidential nature of the data invovled in the automation, opt for appropriate hosting options.
Recommended Hosting Option: devVM/UBVM
- Install GNOME desktop for selenium
sudo yum groups install "GNOME Desktop"
If error, [RHEL 7 / Cent OS 7 – “fwupdate-efi” conflicts with “grub2-common”] is shown while executing 1), then run the following
sudo yum upgrade grub2 firewalld
sudo yum update --security
- Enable graphical target
sudo systemctl enable graphical.target --force
sudo rm '/etc/systemd/system/default.target'
sudo ln -s '/usr/lib/systemd/system/graphical.target' '/etc/systemd/system/default.target'
- Install chrome browser
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
sudo yum localinstall google-chrome-stable_current_x86_64.rpm
- Reboot the system for GUI to kick in
sudo reboot
Python Version: 3.65 or above
-
Create a telegram bot by following this documentation that will provide you an API KEY
-
Though this bot can be searched publicly, we will make this bot a personal/private assistant by following the steps below.
- Open this URL, replace <XXX: YYYYY> with your bot API Key
https://api.telegram.org/bot<XXX:YYYYY>/getUpdates
- Send a
/start
command or'Hi'
message to your bot.
- After ii), refresh the URL, the web page should show a JSON, from which you can grab the
'chat.id'
(It's an integer)
-
Generate Expensify UserID and Secret by following this documentation
-
git clone https://github.com/premkarat/expensify_bot.git
-
cd expensify_bot; pip install -r requirements.txt
(Optionally create a virtual environment) -
cp config.py.example to config.py and edit following configuration
- Config.TELEGRAM.API_KEY
- Config.TELEGRAM.CHAT_ID
- Config.EXPENSIFY.USERID
- Config.EXPENSIFY.SECRET
- Config.EXPENSIFY.EMP_MAILID
- Config.OKTA.USERNAME
- Config.OKAT.PASSWORD
-
Start the bot, using the following command
python3 bot.py &