erlc-api 1.3.6 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,6 @@ Setting up is super simple:
|
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
16
|
// index.js
|
|
17
|
-
|
|
18
17
|
const erlc = require("erlc");
|
|
19
18
|
const client = new erlc.Client({
|
|
20
19
|
globalToken: "", // You get the global key directly from the ERLC developers. To increase your API request limits
|
|
@@ -26,12 +25,12 @@ Now you can start using API Methods - here are a few examples:
|
|
|
26
25
|
|
|
27
26
|
```js
|
|
28
27
|
// GetServerInfo.js
|
|
29
|
-
const erlc = require("erlc-api");
|
|
28
|
+
const erlc = require("erlc-api"); //JS
|
|
29
|
+
import erlc from "erlc-api"; // Module or typeScript
|
|
30
30
|
|
|
31
31
|
const getServerFunc = async () => {
|
|
32
32
|
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
33
33
|
const server = await erlc.getServer(serverId).catch(console.log); // Gets the server, logs any errors
|
|
34
|
-
|
|
35
34
|
console.log(server); // Logs the server object
|
|
36
35
|
|
|
37
36
|
// Expected Response:
|
|
@@ -51,6 +50,30 @@ const getServerFunc = async () => {
|
|
|
51
50
|
getServerFunc();
|
|
52
51
|
```
|
|
53
52
|
|
|
53
|
+
```js
|
|
54
|
+
// GetPlayers.js
|
|
55
|
+
|
|
56
|
+
const erlc = require("erlc-api"); //JS
|
|
57
|
+
import erlc from "erlc-api"; // Module or typeScript
|
|
58
|
+
|
|
59
|
+
const getPlayersFunc = async () => {
|
|
60
|
+
const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
|
|
61
|
+
const server = await erlc.getPlayers(serverId).catch(console.log); // Gets the server, logs any errors
|
|
62
|
+
console.log(server); // Logs the server object
|
|
63
|
+
|
|
64
|
+
// Expected Response:
|
|
65
|
+
// [
|
|
66
|
+
// {
|
|
67
|
+
// "Permission": "Server Owner" Or Member, Moderator,
|
|
68
|
+
// "Player": "Player-Username and ID" ,
|
|
69
|
+
// "Team": "Civilian" Or Fire, Police, Sherift
|
|
70
|
+
// }
|
|
71
|
+
// ]
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
getPlayersFunc();
|
|
75
|
+
```
|
|
76
|
+
|
|
54
77
|
### [Discord Bot](https://discord.com/oauth2/authorize?client_id=1014990793280323624)
|
|
55
78
|
|
|
56
79
|
The Discord Bot Back Online 29/05/2024
|