Skip to content

Uncommon-Dev/discord-embed-generator

 
 

Repository files navigation

Embed Generator

Release Docker image

Release MIT License Discord Server

A powerful tool for creating rich-embed Discord messages using webhooks.

You will usually want to use the hosted version at https://message.style. There is not much benefit in hosting this yourself.

YouTube tutorial

Youtube Tutorial

Self Hosting

This describes the easiest way to self host an instance of Embed Generator by creating a single binary that contains both the backend and frontend.

You can find prebuilt binaries of the server with the frontend files included here.

Build the app

You can download NodeJS and NPM from nodejs.org.

# Switch to the embedg-app directory
cd embedg-app

# Install yarn globally
npm install -g yarn

# Install dependencies
yarn install

# Start the development server (optional)
yarn dev

# Build for production use
yarn build

Build the site (home page & docs)

# Switch to the embedg-app directory
cd embedg-site

# Install yarn globally
npm install -g yarn

# Install dependencies
yarn install

# Start the development server (optional)
yarn start

# Build for production use
yarn build

Build the server (backend)

Install Go from go.dev.

# Switch to the backend directory
cd embedg-server
# or if you are in the frontend directoy
cd ../embedg-server

# Configure the server (see steps below)

# Run database migrations
go run main.go migrate postgres up

# Start the development server (optional)
go run --tags "embedapp embedsite" main.go server

# Build and include the frontend files in the backend binary (build app and site first)
go build --tags  "embedapp embedsite"

# Build without including the frontend files in the backend binary (you need to serve yourself)
go build

Install databases

Install PostgresQL on your device and create a user and database. I'm sure you can find instructions online!

Configure the server

To configure the server you can create a file called config.yaml with the following fields:

development: true

discord:
  client_id: ""
  client_secret: ""
  token: ""

openai:
  api_key: "" # for ChatGPT integration (optional)

postgres:
  host: "localhost"
  port: 5432
  dbname: "embedg"
  user: "postgres"
  password: ""

app:
  public_url: "http://localhost:5173/app"

api:
  # Make sure to add {public_url}/auth/callback to the OAuth2 Redirect URLs of your application in the Discord dev portal
  public_url: "http://localhost:5173/api"

  host: "localhost"
  port: 8080

You can also set the config values using environment variables. For example EMBEDG_DISCORD__TOKEN will set the discord token.

Run the binary

You should now be able to run the binary and host your own instance of Embed Generator. You usually want to deploy this behind a reverse proxy like Nginx and terminate TLS there.

About

Create rich embed messages for Discord

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • TypeScript 69.2%
  • Go 20.1%
  • CSS 7.5%
  • JavaScript 2.9%
  • Other 0.3%