The bot is already hosted on heroku. Click this link to add bot to your discord server
- Create a virtual environment
virtualenv -p /usr/local/bin/python3 venv
- Install dependencies
pip install -r requirements.txt
- Create
.env
file and add the contents using .env.example file. - Create your discord bot by visiting developers console
- Copy the bot token and add to .env file.
- Create your PostgreSQL database and enter credentials in .env file
- Create the table 'searches' using the SQL query:
Create table searches (user_id varchar(256), keyword varchar(256), created_at timestamp);
- Create custom search engine using Google Search API and insert the developer Api key and search engine ID in .env file.
- Run the app
python3 bot.py
- If a user sends 'hi', the bot will reply 'hey'
- if a user sends '!google YOUR_QUERY_HERE', and it'll reply with the top five links
- if a user sends '!recent YOUR_QUERY_HERE', and it'll reply with a list of similar searches in the user's history