dangle / alfred

Alfred is an extensible Discord bot that can use ChatGPT to respond conversationally and run commands on behalf of the server users.

Home Page:https://dangle.github.io/alfred/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alfred

Alfred is an extensible Discord bot that can use ChatGPT to respond conversationally and run commands on behalf of the server users.

Installation

Prerequisites

Get Required Values

  1. Create a Discord App and get the token.

Important

For conversational chat support you will need to give the priviledged intents for messages and presence.

Get Optional Values

  1. Get your Discord server ID

Note

Not supplying this will cause commands to be registered as global and they may take up to an hour to become available.

  1. Get an OpenAI API key

Warning

Not supplying this will prevent Alfred from responding conversationally and only slash commands will be available.

Guided Installation Script

The easiest way to install the bot is to run the guided installation script.

curl -sSL https://raw.githubusercontent.com/dangle/alfred/main/install.sh | sudo bash

Warning

Always verify the contents of any code from the internet before running it.

Manually Install Using Docker Compose

  1. Create a folder to store your configuration.
mkdir -p /opt/alfred
cd /opt/alfred
  1. Download the docker-compose.yml file from the repository.
curl -O https://raw.githubusercontent.com/dangle/alfred/main/docker-compose.yml
  1. Create a .env file with the following variables:
DISCORD_TOKEN="discord token"
DISCORD_GUILD_IDS="Discord server ID"
OPENAI_API_KEY"OpenAI API key"
  1. Start the service
docker-compose up

Contributing

  1. Fork the repository
  2. Clone your fork locally
  3. Use the devcontainer.
    1. If you use VS Code it will prompt you to open the project in the devcontainer once you open the folder.
    2. If you prefer not to use VS Code, you can use the devcontainer-cli to run the devcontainer.
  4. Verify your changes using pdm start.
  5. Once you are ready to submit a pull request, run pdm check to ensure your changes can be merged successfully.

About

Alfred is an extensible Discord bot that can use ChatGPT to respond conversationally and run commands on behalf of the server users.

https://dangle.github.io/alfred/

License:MIT License


Languages

Language:Python 92.3%Language:Shell 4.3%Language:Makefile 3.0%Language:Dockerfile 0.4%