Skip to content

Commit bba940b

Browse files
committed
doc: documentation tweaks
1 parent 59c5257 commit bba940b

File tree

2 files changed

+43
-8
lines changed

2 files changed

+43
-8
lines changed

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@ The community-maintained Node.js library for Top.gg.
77
## Chapters
88

99
- [Installation](#installation)
10-
- [NPM](#npm)
11-
- [Yarn](#yarn)
1210
- [Setting up](#setting-up)
13-
- [v1](#v1)
14-
- [v0](#v0)
1511
- [Usage](#usage)
1612
- [API v1](#api-v1)
1713
- [Getting your project's vote information of a user](#getting-your-projects-vote-information-of-a-user)
@@ -48,15 +44,17 @@ $ yarn add @top-gg/sdk
4844
## Setting up
4945

5046

51-
### v1
47+
### API v1
48+
49+
Note that API v1 also includes API v0.
5250

5351
```js
5452
import Topgg from "@top-gg/sdk";
5553

5654
const client = new Topgg.V1Api(process.env.TOPGG_TOKEN);
5755
```
5856

59-
### v0
57+
### API v0
6058

6159
```js
6260
import Topgg from "@top-gg/sdk";
@@ -128,6 +126,26 @@ const commands = await bot.application.getGlobalCommands();
128126
await client.postBotCommands(commands);
129127
```
130128

129+
##### Raw
130+
131+
```js
132+
await client.postBotCommands([
133+
{
134+
options: [],
135+
name: 'test',
136+
name_localizations: null,
137+
description: 'command description',
138+
description_localizations: null,
139+
contexts: [],
140+
default_permission: null,
141+
default_member_permissions: null,
142+
dm_permission: false,
143+
integration_types: [],
144+
nsfw: false
145+
}
146+
]);
147+
```
148+
131149
### API v0
132150

133151
#### Getting a bot

src/structs/Api.ts

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
} from "../typings";
2020

2121
/**
22-
* Top.gg API v0 Client
22+
* Top.gg API v0 client
2323
*
2424
* @example
2525
* ```js
@@ -274,7 +274,7 @@ export class Api extends EventEmitter {
274274
}
275275

276276
/**
277-
* Top.gg API v1 Client
277+
* Top.gg API v1 client
278278
*
279279
* @example
280280
* ```js
@@ -320,6 +320,23 @@ export class V1Api extends Api {
320320
* const commands = await bot.application.getGlobalCommands();
321321
*
322322
* await client.postBotCommands(commands);
323+
*
324+
* // Raw:
325+
* await client.postBotCommands([
326+
* {
327+
* options: [],
328+
* name: 'test',
329+
* name_localizations: null,
330+
* description: 'command description',
331+
* description_localizations: null,
332+
* contexts: [],
333+
* default_permission: null,
334+
* default_member_permissions: null,
335+
* dm_permission: false,
336+
* integration_types: [],
337+
* nsfw: false
338+
* }
339+
* ]);
323340
* ```
324341
*
325342
* @param {APIApplicationCommand[]} commands A list of application commands in raw Discord API JSON objects. This cannot be empty.

0 commit comments

Comments
 (0)