BlueStacks Discord Bot
Steps to run bot:
- 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.txt 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), search_time timestamp); - Create custom search engine using Google Search API and insert the developer and search engine ID in .env file.
- Run the app -
python3 bot.py
Expected Output -
- 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