Merge pull request #5 from tcrms/main

Minor Changes
This commit is contained in:
Shay DeWael
2022-05-17 10:28:23 -07:00
committed by GitHub
2 changed files with 3 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ git clone https://github.com/discord/discord-example-app.git
Then navigate to its directory and install dependencies:
```
cd discord-getting-started
cd discord-example-app
npm install
```
### Get app credentials

View File

@@ -17,7 +17,7 @@ export function VerifyDiscordRequest(clientKey) {
export async function DiscordRequest(endpoint, options) {
// append endpoint to root API URL
const url = 'https://discord.com/api/v9/' + endpoint;
const url = 'https://discord.com/api/v10/' + endpoint;
// Stringify payloads
if (options.body) options.body = JSON.stringify(options.body);
// Use node-fetch to make requests
@@ -25,6 +25,7 @@ export async function DiscordRequest(endpoint, options) {
headers: {
Authorization: `Bot ${process.env.DISCORD_TOKEN}`,
'Content-Type': 'application/json; charset=UTF-8',
'User-Agent': 'DiscordBot (https://github.com/discord/discord-example-app, 1.0.0)',
},
...options
});