Skip to content

Send webhook messages from your browser (and so much more)

License

Notifications You must be signed in to change notification settings

scanash00/discohook

 
 

Repository files navigation

Discohook

Simple, free, and highly versatile message designer for Discord webhooks.

Feature comparison

This is a complete rewrite of the original Discohook project by @maddysrc, now under new ownership. Read the full changelog.

Free?

Discohook is free, but you are encouraged to donate and get extra perks!

Meta

This monorepo comes in a few main parts:

  • site - The Discohook website
  • bot - Handles Discord interactions & proxied gateway events
  • bot-ws - Proxies gateway events to bot
  • magic-backup-importer - Hosted on a domain where users may have local backups stored (site redirects here and vice versa)
  • link - Hosted on a subdomain or shorter domain, used for redirecting to /link/...

Along with some shared packages:

  • store - Database & KV utilities

Attribution

Translations

Thanks to Language(s) Progress
anonymous Chinese
mew610 Arabic
maddymeows Dutch
yaraej_ Spanish
French
dustytheonly German
ilprofilodineko Italian

Original Project

Big thanks to @maddysrc and @crawron for creating the original Discohook project in 2019 and later working with me to gracefully transfer ownership after 5 years.

Development

Contributing

Before submitting your pull request, please remember to run npx biome check . to check for errors, then yarn fix to format. This repository uses Biome, not ESLint/Prettier. You may also want to install the Biome extension for your editor.

As far as style preferences not covered by the Biome configuration:

  • Use n += 1 rather than n++
  • Prefer chaining schemas (z.string().optional()) over nesting (z.optional(z.string()))
  • Prefer Drizzle callbacks where possible ((table, { eq }) => eq(table.id, id)) over importing individual tables and functions

Bot

Run yarn dev:bot to start a miniflare server for the "primary" portion of the bot. To expose the local server to the internet so that Discord can request it, we use cloudflared, but you may find it more convenient to simply install ngrok instead. Once you're done with that, copy your tunneled URL to your Discord application's "Interactions Endpoint URL" field.

interactions-endpoint

If you would also like to work on gateway event processing (the "response" logic for which is contained in the primary portion), you will need to run yarn bot-ws to start an instance of the gateway-connected bot. Be sure to define the required environment variables as described in its README. While testing, use the Ngrok URL from above as your WORKER_ORIGIN so that you can use the Ngrok web interface to replay events.

Site

Run yarn dev:site to start a miniflare server for the site.

If you want to develop magic-backup-importer, also run yarn dev:backups after setting up its environment. This will be hosted on http://localhost:8789 by default. To save a backup to the local database, uncomment the execution of the saveBackup() method in the index route's useEffect callback.

Deployment

This project relies on Durable Objects for many core features, which is a product exclusive to accounts on the Workers Paid plan. If you do not want to subscribe to Workers Paid, you will have to remove these features in your fork.

Or, if you don't want to do either of those, consider joining the support server and letting me know what you want to see in the main instance.

About

Send webhook messages from your browser (and so much more)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.9%
  • CSS 2.9%
  • JavaScript 1.2%