Skip to content

Commit a5db985

Browse files
EhsanFoxjpbberry
andauthored
Docs changes (#53)
* Replaced all `client` with `api` * Removed leftover from client enabled package Co-authored-by: Julian Berryessa <[email protected]>
1 parent aef08ca commit a5db985

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

docs/Api.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Post bot stats to Top.gg (Do not use if you supplied a client)
5252

5353
**Example**
5454
```js
55-
await client.postStats({
55+
await api.postStats({
5656
serverCount: 28199,
5757
shardCount: 1
5858
})
@@ -71,7 +71,7 @@ Get a bots stats
7171

7272
**Example**
7373
```js
74-
await client.getStats('461521980492087297')
74+
await api.getStats('461521980492087297')
7575
// =>
7676
{
7777
serverCount: 28199,
@@ -93,7 +93,7 @@ Get bot info
9393

9494
**Example**
9595
```js
96-
await client.getBot('461521980492087297') // returns bot info
96+
await api.getBot('461521980492087297') // returns bot info
9797
```
9898
<a name="Api+getUser"></a>
9999

@@ -109,7 +109,7 @@ Get user info
109109

110110
**Example**
111111
```js
112-
await client.getUser('205680187394752512')
112+
await api.getUser('205680187394752512')
113113
// =>
114114
user.username // Xignotic
115115
```
@@ -128,7 +128,7 @@ Get a list of bots
128128
**Example**
129129
```js
130130
// Finding by properties
131-
await client.getBots({
131+
await api.getBots({
132132
search: {
133133
username: 'shiro',
134134
certifiedBot: true
@@ -153,7 +153,7 @@ await client.getBots({
153153
total: 1
154154
}
155155
// Restricting fields
156-
await client.getBots({
156+
await api.getBots({
157157
fields: ['id', 'username']
158158
})
159159
// =>
@@ -181,7 +181,7 @@ Get users who've voted
181181
**Returns**: <code>Array.&lt;ShortUser&gt;</code> - Array of users who've voted
182182
**Example**
183183
```js
184-
await client.getVotes()
184+
await api.getVotes()
185185
// =>
186186
[
187187
{
@@ -213,7 +213,7 @@ Get whether or not a user has voted in the last 12 hours
213213

214214
**Example**
215215
```js
216-
await client.hasVoted('205680187394752512')
216+
await api.hasVoted('205680187394752512')
217217
// => true/false
218218
```
219219
<a name="Api+isWeekend"></a>
@@ -225,6 +225,6 @@ Whether or not the weekend multiplier is active
225225
**Returns**: <code>Boolean</code> - Whether the multiplier is active
226226
**Example**
227227
```js
228-
await client.isWeekend()
228+
await api.isWeekend()
229229
// => true/false
230230
```

src/structs/Api.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ export class Api extends EventEmitter {
6767
}
6868

6969
/**
70-
* Post bot stats to Top.gg (Do not use if you supplied a client)
70+
* Post bot stats to Top.gg
7171
* @param {Object} stats Stats object
7272
* @param {number} stats.serverCount Server count
7373
* @param {number?} stats.shardCount Shard count
7474
* @param {number?} stats.shardId Posting shard (useful for process sharding)
7575
* @returns {BotStats} Passed object
7676
* @example
77-
* await client.postStats({
77+
* await api.postStats({
7878
* serverCount: 28199,
7979
* shardCount: 1
8080
* })
@@ -96,7 +96,7 @@ export class Api extends EventEmitter {
9696
* @param {Snowflake} id Bot ID
9797
* @returns {BotStats} Stats of bot requested
9898
* @example
99-
* await client.getStats('461521980492087297')
99+
* await api.getStats('461521980492087297')
100100
* // =>
101101
* {
102102
* serverCount: 28199,
@@ -119,7 +119,7 @@ export class Api extends EventEmitter {
119119
* @param {Snowflake} id Bot ID
120120
* @returns {BotInfo} Info for bot
121121
* @example
122-
* await client.getBot('461521980492087297') // returns bot info
122+
* await api.getBot('461521980492087297') // returns bot info
123123
*/
124124
public async getBot (id: Snowflake): Promise<BotInfo> {
125125
if (!id) throw new Error('ID Missing')
@@ -131,7 +131,7 @@ export class Api extends EventEmitter {
131131
* @param {Snowflake} id User ID
132132
* @returns {UserInfo} Info for user
133133
* @example
134-
* await client.getUser('205680187394752512')
134+
* await api.getUser('205680187394752512')
135135
* // =>
136136
* user.username // Xignotic
137137
*/
@@ -146,7 +146,7 @@ export class Api extends EventEmitter {
146146
* @returns {BotsResponse} Return response
147147
* @example
148148
* // Finding by properties
149-
* await client.getBots({
149+
* await api.getBots({
150150
* search: {
151151
* username: 'shiro',
152152
* certifiedBot: true
@@ -171,7 +171,7 @@ export class Api extends EventEmitter {
171171
* total: 1
172172
* }
173173
* // Restricting fields
174-
* await client.getBots({
174+
* await api.getBots({
175175
* fields: ['id', 'username']
176176
* })
177177
* // =>
@@ -205,7 +205,7 @@ export class Api extends EventEmitter {
205205
* Get users who've voted
206206
* @returns {ShortUser[]} Array of users who've voted
207207
* @example
208-
* await client.getVotes()
208+
* await api.getVotes()
209209
* // =>
210210
* [
211211
* {
@@ -233,7 +233,7 @@ export class Api extends EventEmitter {
233233
* @param {Snowflake} id User ID
234234
* @returns {Boolean} Whether the user has voted in the last 12 hours
235235
* @example
236-
* await client.hasVoted('205680187394752512')
236+
* await api.hasVoted('205680187394752512')
237237
* // => true/false
238238
*/
239239
public async hasVoted(id: Snowflake): Promise<boolean> {
@@ -245,7 +245,7 @@ export class Api extends EventEmitter {
245245
* Whether or not the weekend multiplier is active
246246
* @returns {Boolean} Whether the multiplier is active
247247
* @example
248-
* await client.isWeekend()
248+
* await api.isWeekend()
249249
* // => true/false
250250
*/
251251
public async isWeekend (): Promise<boolean> {

0 commit comments

Comments
 (0)