No description
Find a file
2023-03-04 20:57:56 -07:00
src check for messages with no text content 2023-03-04 20:57:56 -07:00
.gitignore initial commit 2023-03-03 22:45:35 -07:00
Cargo.lock initial commit 2023-03-03 22:45:35 -07:00
Cargo.toml improve bookmarks 2023-03-04 12:35:04 -07:00
LICENSE initial commit 2023-03-03 22:45:35 -07:00
README.md tweak readme 2023-03-04 18:16:38 -07:00
rustfmt.toml initial commit 2023-03-03 22:45:35 -07:00
wrangler.example.toml add registration token 2023-03-04 18:07:38 -07:00

bookmarks

bookmarks is a simple bookmarking bot for Discord, designed for Cloudflare Workers and written in Rust. It uses message commands, available via the right click menu on any message. You'll be sent a direct message with the contents of the message.

Public Bot

You can add bookmarks to your server using this invite link.

Setup

Install and configure wrangler.

Copy wrangler.example.toml to wrangler.toml and fill in the application ID and public key from the Discord developer portal.

Use wrangler secret put to save DISCORD_TOKEN (from the Discord developer portal) and REGISTRATION_TOKEN (see below).

Command Registration

Because Cloudflare Workers are serverless, there is no startup in which to register commands. You must register the bookmark command manually one time.

Given your worker is operating on example.yourusername.workers.dev, use curl or another HTTP client to make a POST request to https://example.yourusername.workers.dev/register. If you set the (optional, but recommended) REGISTRATION_TOKEN secret, an Authorization header containing the token will be required, preventing others from accessing the Discord API through your account. The token can contain any text desired.

For example:

curl -H "Authorization: gjsoW9XUoRTRvSYv" -X POST https://example.yourusername.workers.dev