A Discord bot for interacting with the perplexity.ai API https://perplexity.ai
  • Go 97.7%
  • Dockerfile 2.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-08-07 21:02:24 -06:00
commands fix error logs 2025-08-07 20:56:08 -06:00
components initial version done 2025-01-16 20:02:24 -07:00
config initial version done 2025-01-16 20:02:24 -07:00
events add custom status 2025-01-16 20:12:01 -07:00
lib initial version done 2025-01-16 20:02:24 -07:00
services update deps, fix 400 errors 2025-08-07 21:02:24 -06:00
utils add citation injections into response content 2025-01-23 13:40:48 -07:00
.dockerignore add dockerignore 2025-01-16 20:09:25 -07:00
.DS_Store fix error logs 2025-08-07 20:56:08 -06:00
.gitignore initial version done 2025-01-16 20:02:24 -07:00
config.json initial version done 2025-01-16 20:02:24 -07:00
Dockerfile add dockerfile 2025-01-16 20:07:15 -07:00
go.mod update deps, fix 400 errors 2025-08-07 21:02:24 -06:00
go.sum update deps, fix 400 errors 2025-08-07 21:02:24 -06:00
LICENSE Create LICENSE 2025-01-17 06:41:01 -07:00
main.go initial version done 2025-01-16 20:02:24 -07:00
README.md fix docker run cmd in readme 2025-01-17 06:48:46 -07:00

PPLX Bot

A simple Discord bot for searching with Perplexity.

Currently, the bot is private, meaning you'll have to host your own instance, however, I plan to make it public soon.

Hosting

To host an instance of the bot, you'll need to follow these steps:

Prerequisites

  • Go 1.23+
  • Docker (optional)
  • Git
  • A Discord bot token and app ID - you can get one here
  • A Perplexity API key - you can get one here

Setup

First, clone the repository:

git clone https://github.com/dickeyy/pplx-bot.git
cd pplx-bot

Next, create a .env file in the root directory of the project, and add the following variables:

ENVIORNMENT=<prod|dev>
TOKEN=Bot <your token>
DEV_TOKEN=Bot <your dev token> # Optional
APP_ID=<your app id>
DEV_APP_ID=<your dev app id> # Optional
REGISTER_CMDS=<true|false> # Tells the bot whether to register slash commands (needed on first run)
PPLX_API_KEY=<your perplexity api key>

Note: The TOKEN and DEV_TOKEN need the Bot prefix before the actual token.

Running

Finally, build and run the bot, either using Docker or locally:

Docker:

docker build -t pplx-bot .
docker run -d --name pplx-bot --env-file .env pplx-bot

Locally:

go build -o pplx-bot .
./pplx-bot

Now you can invite the bot to your server and start using it!

Commands

The bot only has one command: /search <query> [debug], where query is the search query and debug is an optional boolean to send back some debug information.

Contributing

Contributions are welcome! Please open an issue for discussion before working on a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.