Skip to content

rajat19/bluecord

Repository files navigation

Bluecord (BlueStacks Discord Bot)

Play with bot:

The bot is already hosted on heroku. Click this link to add bot to your discord server

Steps to run bot (locally/development):

  1. Create a virtual environment
virtualenv -p /usr/local/bin/python3 venv
  1. Install dependencies
pip install -r requirements.txt
  1. Create .env file and add the contents using .env.example file.
  2. Create your discord bot by visiting developers console
  3. Copy the bot token and add to .env file.
  4. Create your PostgreSQL database and enter credentials in .env file
  5. Create the table 'searches' using the SQL query:
Create table searches (user_id varchar(256), keyword varchar(256), created_at timestamp);
  1. Create custom search engine using Google Search API and insert the developer Api key and search engine ID in .env file.
  2. Run the app
python3 bot.py

Expected Output -

  1. If a user sends 'hi', the bot will reply 'hey'
  2. if a user sends '!google YOUR_QUERY_HERE', and it'll reply with the top five links
  3. if a user sends '!recent YOUR_QUERY_HERE', and it'll reply with a list of similar searches in the user's history