Discord bot for the Scratch Everywhere! server.
cp .env.example .env # fill it in
bun install
bun startCreate src/commands/<name>.ts. It's registered automatically as both
.<name>, !<name>, and /<name>. Files starting with _ are ignored.
import { defineCommand } from "../command.ts";
export default defineCommand({
description: "Says hi.",
args: [{ name: "who", description: "Who to greet", optional: true }], // optional
run: ({ who }) => ({ title: "Hi", description: `Hello ${who ?? "world"}!` }),
});- Add
autocomplete: (query, ctx) => [{ name, value }]to an arg for slash-command suggestions. - Throw
UserErrorfor a friendly message instead of a logged crash. - For "pick one of these" commands, use
createLookup(src/lookup.ts); seerule.ts.