pycabbage / discordgpt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discordgpt

Build

Discord bot using ChatGPT API

Prebuilt binary

Usage

first, write token/channelID to .env file.

DISCORD_TOKEN=[discord bot token]
DISCORD_CHANNELID=[space-separated channel ids to use the bot]
GPT_SECRET_KEY=[OpenAI APIKEY]

Run prebuilt binary locally

curl -kLO https://nightly.link/pycabbage/discordgpt/workflows/build/main/discordgpt-linux-amd64.zip
unzip discordgpt-linux-amd64.zip
chmod +x discordgpt-linux-amd64
./discordgpt-linux-amd64
docker run --rm -it --env-file .env ghcr.io/pycabbage/discordgpt:latest
# or specify token/channelID
docker run --rm -it \
  -e DISCORD_TOKEN=[discord bot token] \
  -e DISCORD_CHANNELID=[space-separated channel ids to use the bot] \
  -e GPT_SECRET_KEY=[OpenAI APIKEY] \
  ghcr.io/pycabbage/discordgpt:latest

Build Mannualy

Run locally

# Build binary
go build -o discordgpt
# Run
./discordgpt

Run on container

# Build binary
GOOS=linux GOARCH=amd64 go build -ldflags '-w -s' -o discordgpt-linux-amd64
# Build container
docker build . -t discordgpt:latest --build-arg BINARY=discordgpt-linux-amd64
# Run container
docker run --rm -it --env-file .env discordgpt:latest

About

License:MIT License


Languages

Language:Go 96.6%Language:Dockerfile 3.4%