Skip to content

wavy-cat/petpet-go

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}.gif or /ds/{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 GIF speed. Bigger is slower
no-cache false Boolean Whether to disable caching (Cache-Control headers)

Custom upload

POST /custom or /c

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 (see Compose example)

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

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages