Skip to content

Repository files navigation

petpet-go

GitHub go.mod Go version GitHub License GitHub repo size

A web service for generating petpet GIFs based on a Discord user's avatar, written in Go.

Usage

Discord avatar

GET /discord/{user_id} or /ds/{user_id}

By default, the response is a WebP. Prepend .gif or .webp to the {user_id} path segment to force a specific format, e.g. /discord/{user_id}.gif.

Path parameters

Name Type Description
{user_id} Snowflake The Discord user's ID

Query parameters

Name Default Type Description
delay 4 Unsigned Integer Animation speed. Bigger is slower
no-cache false Boolean Whether to disable caching (Cache-Control headers)

Custom upload

POST /custom or /c (WebP)

POST /custom/gif or /c/gif (GIF)

POST /custom/webp or /c/webp (WebP)

Send a multipart/form-data request with a file field named image containing a PNG, JPEG or WebP.

The upload is limited to 5MB and a maximum of 1 MP (you can reconfigure it).

Getting started

  • Static binaries available as releases
  • GHCR or docker pull ghcr.io/wavy-cat/petpet-go

Note

The Discord bot sends preview requests from the us-east1 GCP region (South Carolina, US). To reduce network latency, choose server locations close to it. If using a Cloudflare proxy, the nearest Cloudflare location is ATL (Atlanta, US).

Configuration

Currently, config parameters can be specified either in the config.yml file or via environment variables.

Outbound HTTP proxy settings are handled by Go's standard environment variables: HTTP_PROXY, HTTPS_PROXY, and NO_PROXY.

Look at the configuration reference with comments (including environment variable names).

PetPet in other languages

About

Petpet GIF generator, written in Go

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages