|
2 | 2 |
|
3 | 3 | [](https://www.npmjs.com/package/discord.https) |
4 | 4 | [](LICENSE) |
5 | | -[](https://www.npmjs.com/package/discord.https) |
| 5 | +[](https://www.npmjs.com/package/discord.https/index.default.html) |
6 | 6 |
|
7 | 7 | **Discord.https** is a robust, modular library for implementing Discord HTTP interactions. |
8 | 8 |
|
9 | 9 | It handles various interactions and organizes them into modular routes, making your bot's code cleaner, easier to understand, and easier to maintain. It works seamlessly in both serverless and persistent server environments. |
10 | 10 |
|
11 | 11 | The core is production-ready and can be used in your new http interaction bots. |
12 | 12 |
|
| 13 | +📄 **Documentation:** [https://discordhttps.github.io/discord.https/](https://discordhttps.github.io/discord.https/) |
| 14 | + |
13 | 15 | ```js |
14 | | -import Client from "discord.https"; |
| 16 | +import Client, { InteractionResponseType } from "discord.https"; |
15 | 17 | import NodeAdapter from "@discordhttps/nodejs-adapter"; |
16 | | -import { InteractionResponseType } from "discord-api-types/v10"; |
17 | 18 |
|
18 | 19 | const client = new Client({ |
19 | 20 | token: "YOUR BOT TOKEN", |
@@ -57,10 +58,12 @@ await client.listen("interactions", 3000, () => { |
57 | 58 |
|
58 | 59 | > **Note**: Utility methods such as <interaction>.editReply() and <interaction>.deferReply() are currently in development, so you won’t need to manually handle the raw response object in the future. |
59 | 60 |
|
| 61 | +> **Note**: Utility methods were initially planned to closely follow Discord.js. However, since HTTP interactions are mostly used in a serverless environment, instead of having many layers of objects like Discord.js, an Eris-like approach will be adopted to keep the utilities minimal and lightweight. |
| 62 | +
|
60 | 63 | ### To do: |
61 | 64 |
|
62 | | -- [ ] Build structures → reference: [discord.js - structures](https://github.com/discordjs/discord.js/tree/main/packages/discord.js/src/structures) |
63 | | -- [ ] Build a simplified `npx create-app` command [in progress] |
| 65 | +- [ ] Build structures |
| 66 | +- [ ] Build a simplified `npx create-app` command |
64 | 67 | - [ ] Implement tests |
65 | 68 | - [x] HTTP adapters to support all hosting environments. Currently implemented: Node.js adapter for [Node.js runtime](https://github.com/discord-http/nodejs-adapter) and [Cloudflare adapter for V8 isolates runtime](https://github.com/discord-http/cloudflare-adapter) |
66 | | -- [x] Examples [will be published soon] |
| 69 | +- [x] Examples |
0 commit comments