@discordjs/rest 1.7.2-dev.1683374649-8d5ce32.0 → 1.7.2-dev.1683504576-5b8d535.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/CDN-f8818ced.d.ts +783 -0
- package/dist/index.d.ts +10 -769
- package/dist/index.js +140 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +146 -92
- package/dist/index.mjs.map +1 -1
- package/dist/strategies/undiciRequest.d.ts +14 -0
- package/dist/strategies/undiciRequest.js +93 -0
- package/dist/strategies/undiciRequest.js.map +1 -0
- package/dist/strategies/undiciRequest.mjs +69 -0
- package/dist/strategies/undiciRequest.mjs.map +1 -0
- package/package.json +16 -9
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
-
**Node.js
|
|
26
|
+
**Node.js 18.12.0 or newer is required.**
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
29
|
npm install @discordjs/rest
|
|
@@ -80,6 +80,25 @@ try {
|
|
|
80
80
|
}
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
Send a basic message in an edge environment:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
import { REST } from '@discordjs/rest';
|
|
87
|
+
import { Routes } from 'discord-api-types/v10';
|
|
88
|
+
|
|
89
|
+
const rest = new REST({ version: '10', makeRequest: fetch }).setToken(TOKEN);
|
|
90
|
+
|
|
91
|
+
try {
|
|
92
|
+
await rest.post(Routes.channelMessages(CHANNEL_ID), {
|
|
93
|
+
body: {
|
|
94
|
+
content: 'A message via REST from the edge!',
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
} catch (error) {
|
|
98
|
+
console.error(error);
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
83
102
|
## Links
|
|
84
103
|
|
|
85
104
|
- [Website][website] ([source][website-source])
|