@@ -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