Skip to content

Commit 4f0e925

Browse files
committed
fix(update): commands in readme
1 parent 682ede4 commit 4f0e925

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ there is just a few commands you need to remember and you will be on your way!
2828
- `npm run test` - Run tests on all packages to make sure things are working
2929
- `npm run validate` - Check for valid formatting
3030
- `npm run publish` - Publish package(s) to npm and update versions
31+
- `npm run patch` - Publish package(s) under pre-release versions
32+
- [versioning info](https://i.stack.imgur.com/fnalf.png)
3133

3234
## Versioning
3335
Semantic versioning (often abbreviated as “semver”) is a convention used for software versioning in a standardized way. Using semantic versioning, each version number is comprised of three parts: major, minor, and patch, which are incremented when:

packages/sdk/src/client/get.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ export default class InfinityFetcher {
2121
* =================================================
2222
*/
2323
public async getUserVotes(userID?: string) {
24-
if (!userID || typeof userID !== 'string')
24+
if (!userID || typeof userID !== 'string') {
2525
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid user id')
26-
else if (!this.botID || typeof this.botID !== 'string')
26+
} else if (!this.botID || typeof this.botID !== 'string') {
2727
throw new ReferenceError('[@infinitylist/sdk]: Please provide a valid discord bot id')
28+
}
2829

2930
const res = await fetch(`https://spider.infinitybots.gg/users/${userID}/bots/${this.botID}/votes`, {
3031
method: 'GET',
@@ -61,8 +62,9 @@ export default class InfinityFetcher {
6162
* =================================================
6263
*/
6364
public async getBotInfo() {
64-
if (!this.botID)
65+
if (!this.botID) {
6566
throw new ReferenceError('[@infinitylist/sdk]: no client id provided, please provide a bot id!')
67+
}
6668

6769
const res = await fetch(`https://spider.infinitybots.gg/bots/${this.botID}`, {
6870
method: 'GET',

packages/sdk/src/client/post.ts

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ export default class InfinityPoster {
2424
* @requires servers
2525
*/
2626
public async postServerCount({ servers }: Bot) {
27-
if (!this.apiKey) throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
28-
else if (!this.botID || typeof this.botID === 'string')
27+
if (!this.apiKey) {
28+
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
29+
} else if (!this.botID || typeof this.botID === 'string') {
2930
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid discord bot id')
30-
else if (!servers || typeof servers !== 'number')
31+
} else if (!servers || typeof servers !== 'number') {
3132
throw new ReferenceError(
3233
'[@infinitylist/sdk]: please provide a valid server count, should be a valid integer of 1 or greater!'
3334
)
35+
}
3436

3537
const res = await fetch('https://spider.infinitybots.gg/bots/stats', {
3638
method: 'POST',
@@ -65,13 +67,15 @@ export default class InfinityPoster {
6567
* @requires shards
6668
*/
6769
public async postShardCount({ shards }: Bot) {
68-
if (!this.apiKey) throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
69-
else if (!this.botID || typeof this.botID === 'string')
70+
if (!this.apiKey) {
71+
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
72+
} else if (!this.botID || typeof this.botID === 'string') {
7073
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid discord bot id')
71-
else if (!shards || typeof shards !== 'number')
74+
} else if (!shards || typeof shards !== 'number') {
7275
throw new ReferenceError(
7376
'[@infinitylist/sdk]: please provide a valid shard count, should be a valid integer of 1 or greater!'
7477
)
78+
}
7579

7680
const res = await fetch('https://spider.infinitybots.gg/bots/stats', {
7781
method: 'POST',
@@ -106,13 +110,15 @@ export default class InfinityPoster {
106110
* @requires users
107111
*/
108112
public async postUserCount({ users }: Bot) {
109-
if (!this.apiKey) throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
110-
else if (!this.botID || typeof this.botID === 'string')
113+
if (!this.apiKey) {
114+
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
115+
} else if (!this.botID || typeof this.botID === 'string') {
111116
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid discord bot id')
112-
else if (!users || typeof users !== 'number')
117+
} else if (!users || typeof users !== 'number') {
113118
throw new ReferenceError(
114119
'[@infinitylist/sdk]: please provide a valid user count, should be a valid integer of 1 or greater!'
115120
)
121+
}
116122

117123
const res = await fetch('https://spider.infinitybots.gg/bots/stats', {
118124
method: 'POST',
@@ -149,21 +155,23 @@ export default class InfinityPoster {
149155
* @requires users The user count of your bot/client.
150156
*/
151157
public async postBotStats({ servers, shards, users }: Bot) {
152-
if (!this.apiKey) throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
153-
else if (!this.botID || typeof this.botID === 'string')
158+
if (!this.apiKey) {
159+
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid infinity api bot token')
160+
} else if (!this.botID || typeof this.botID === 'string') {
154161
throw new ReferenceError('[@infinitylist/sdk]: please provide a valid discord bot id')
155-
else if (!servers || typeof servers !== 'number')
162+
} else if (!servers || typeof servers !== 'number') {
156163
throw new ReferenceError(
157164
'[@infinitylist/sdk]: please provide a valid server count, should be a valid integer of 1 or greater!'
158165
)
159-
else if (!shards || typeof shards !== 'number')
166+
} else if (!shards || typeof shards !== 'number') {
160167
throw new ReferenceError(
161168
'[@infinitylist/sdk]: please provide a valid shard count, should be a valid integer of 1 or greater!'
162169
)
163-
else if (!users || typeof users !== 'number')
170+
} else if (!users || typeof users !== 'number') {
164171
throw new ReferenceError(
165172
'[@infinitylist/sdk]: please provide a valid user count, should be a valid integer of 1 or greater!'
166173
)
174+
}
167175

168176
const res = await fetch('https://spider.infinitybots.gg/bots/stats', {
169177
method: 'POST',

0 commit comments

Comments
 (0)