A Discord bot written in Python3 and Discord.py meant to search the Web semantically. Full slash command support, as well as guild-wide use.

mitch donaberger 07efaf481a feat: Add help text response for DMs and mentions 1 month ago
Dockerfile d55272a62f added Docker files 1 month ago
README.md 5ca5c4ea1b Update 'README.md' 1 month ago
bot.py 07efaf481a feat: Add help text response for DMs and mentions 1 month ago
docker-compose.yml d55272a62f added Docker files 1 month ago
requirements.txt 0c720c2895 first commit - Wed Dec 3 06:03:33 PM EST 2025 1 month ago

README.md

A screenshot of a Discord bot in action

Perplexica Discord Bot

This is a Python-based Discord bot that acts as a client for the Perplexica API. It allows users to perform searches and get answers directly in Discord.

Features

  • /search: Perform a search using the Perplexica API.
  • /mode: Switch between Balanced and Fast search modes.
  • Beautifully formatted responses using Discord embeds.
  • Includes citations and sources.

Prerequisites

  • Python 3.8 or higher
  • A running instance of the Perplexica application.
  • A Discord Bot Token.

Setup

  1. Clone the repository (or download the files into a perplexica-discord-bot directory):

    git clone https://github.com/your-username/perplexica-discord-bot.git
    cd perplexica-discord-bot
    
  2. Install the required Python libraries:

    pip install -r requirements.txt
    
  3. Configure the Bot:

    • Rename the .env.example file to .env (or create a new .env file).
    • Open the .env file and replace "YOUR_DISCORD_BOT_TOKEN_HERE" with your actual Discord bot token.

      DISCORD_BOT_TOKEN="YOUR_DISCORD_BOT_TOKEN_HERE"
      
  4. Ensure your Perplexica instance is running.

    • By default, the bot will try to connect to the Perplexica API at http://localhost:3000/api/search. If your Perplexica instance is running on a different address, update the PERPLEXICA_API_URL variable in bot.py.

Running the Bot

Once the setup is complete, you can run the bot with the following command:

python bot.py

You should see a message in your console confirming that the bot has logged in and is ready.

Usage

Once the bot is running and has joined your Discord server, you can use the following slash commands:

  • /search <your query>: Get an answer to your question.
    • Example: /search Who is the founder of Microsoft?
  • /mode <mode>: Change your preferred search mode.
    • Example: /mode Fast

Enjoy using Perplexica in Discord!