A simple telegram voting bot based on the python-telegram-bot api.
*To make it more easy to use, I might make a C++ code in the future so you don't have to run through the steps
Prerequsites
- Debian-based linux distros, wsl works (other distros might also work, but have not yet tested), for installation, see below
- before proceeding, update and upgrade packages:
sudo apt update
sudo apt upgrade
- python3 and pip installed:
sudo apt install python3 python3-pip
- python-telegram-bot installed:
pip install python-telegram-bot --upgrade
- git and nano installed (optional):
sudo apt install git nano
Installing ubuntu on Windows (WSL)
- In the search bar, search "features", and select "add or remove windows features"
- Select Windows Subsystem for Linux and Virtual machine platform in the list, then click ok
- Restart your computer
- In microsoft store, find ubuntu and install
- You may also want to install windows terminal in microsoft store
- open ubuntu.exe and finish setup
Running ubuntu in a virtual machine
- You can use hyper-v, virtualbox, etc. for a desktop environment
- To install hyper-v on windows home version, see my repository
Installing ubuntu on your android phone
- In F-Droid, find and install userLAnd
- select and setup ubuntu in userLAnd, use ssh for connection
- run
sudo apt update
andsudo apt upgrade
Building the bot
- Talk with @botfather in telegram to create a bot, and obtain its token
- Clone the repository:
git clone https://github.com/wcyat/telegram-voting-bot/
- Switch to directory:
cd telegram-voting-bot
- Edit votebot.py:
nano votebot.py
Replace <> values with your own (eg. owner=your user id)
5. start the bot:
python3 votebot.py