pkgs/router/README.md (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# @purrkit/router
a meowing, typesafe interaction router for discord.js
[view on npmx.dev](https://npmx.dev/package/@purrkit/router)
```sh
npm install @purrkit/router
```
see [GET-STARTED.md](./GET-STARTED.md) for a quick introduction to using kitten
here is a quick hello world example
```ts
import { Client } from "discord.js";
import { Kitten } from "@purrkit/router";
const client = new Client({ intents: [] });
const kitten = new Kitten(client);
const helloWorldCommand = kitten.command("hello-world", {
description: "replies with hello world",
run: (interaction) => {
interaction.reply("Hello World!");
},
});
client.once("clientReady", async () => {
kitten.register({
commands: [helloWorldCommand],
});
await kitten.sync();
console.log("ready!!!");
});
client.login(process.env.DISCORD_TOKEN);
```
## copying
this project is licensed under the european union public license (eupl) v1.2.
you can find the full license text either [here][LISC] or on the official
[eupl website][EU], which also contains translations of the license in various
languages.
<!-- links -->
[LISC]: ./LICENSE
[EU]: https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|