erlc-api 1.3.4 → 1.3.6

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 CHANGED
@@ -25,20 +25,38 @@ client.config(); // Registers your client
25
25
  Now you can start using API Methods - here are a few examples:
26
26
 
27
27
  ```js
28
- // api.js
29
-
30
- const erlc = require("erlc");
28
+ // GetServerInfo.js
29
+ const erlc = require("erlc-api");
31
30
 
32
31
  const getServerFunc = async () => {
33
32
  const serverId = ""; // The server ApiKey you wish to target. You can get this api key in your (Server Settings)
34
33
  const server = await erlc.getServer(serverId).catch(console.log); // Gets the server, logs any errors
35
34
 
36
35
  console.log(server); // Logs the server object
36
+
37
+ // Expected Response:
38
+ // {
39
+ // Name: "Your Sever Name",
40
+ // CurrentPlayers: 0,
41
+ // MaxPlayers: 40,
42
+ // JoinKey: "Your Code Join",
43
+ // AccVerifiedReq: "Disabled" | "Email" | "Phone/ID",
44
+ // TeamBalance: true or false ,
45
+ // OwnerUsername: "Your Name",
46
+ // CoOwnerUsernames: [],
47
+ // VanityURL: "https://policeroleplay.community/join?code=YourCode",
48
+ // },
37
49
  };
38
50
 
39
51
  getServerFunc();
40
52
  ```
41
53
 
54
+ ### [Discord Bot](https://discord.com/oauth2/authorize?client_id=1014990793280323624)
55
+
56
+ The Discord Bot Back Online 29/05/2024
57
+
58
+ ## [Module Examples](https://scarlet-2.gitbook.io/erlc-api/)
59
+
42
60
  ### [PRC API Docs](https://apidocs.policeroleplay.community/reference/api-reference)
43
61
 
44
62
  ### Credits
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erlc-api",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "description": "An ER:LC API wrapper for JS/TS",
5
5
  "main": "index.js",
6
6
  "types": "src/types/index.d.ts",
@@ -1,74 +1,81 @@
1
- declare module 'erlc' {
2
- export interface ClientConfig {
3
- globalToken: string // The ER:LC global API token
4
- }
1
+ declare module "erlc-api" {
2
+ export interface ClientConfig {
3
+ globalToken: string; // The ER:LC global API token
4
+ }
5
5
 
6
- export const BASEURL = "https://api.policeroleplay.community/v1"
6
+ export const BASEURL = "https://api.policeroleplay.community/v1";
7
7
 
8
- type PlayerId = string
9
- type PlayerName = string
8
+ type PlayerId = string;
9
+ type PlayerName = string;
10
10
 
11
- export type ErlcPlayer = `${PlayerName}:${PlayerId}` // Playername:UserID
12
- export type ErlcPlayerPermission = "Normal" | "Server Administrator" | "Server Owner" | "Server Moderator"
11
+ export type ErlcPlayer = `${PlayerName}:${PlayerId}`; // Playername:UserID
12
+ export type ErlcPlayerPermission =
13
+ | "Normal"
14
+ | "Server Administrator"
15
+ | "Server Owner"
16
+ | "Server Moderator";
13
17
 
14
- export interface ServerStatus {
15
- Name: string; // The server name
16
- OwnerId: number; // The roblox id of the server owner
17
- CoOwnerIds: number[]; // The roblox ids of the server co owners
18
- CurrentPlayers: number; // The amount of people currently in-game
19
- MaxPlayers: number; // The amount of people who can join the server including server owner
20
- JoinKey: string; // The code used to join the private server
21
- AccVerifiedReq: "Disabled" | "Email" | "Phone/ID"; // The level of verification roblox accounts need to join the private server
22
- TeamBalance: boolean; // If team balance is enabled or not
23
- }
18
+ export interface ServerStatus {
19
+ Name: string; // The server name
20
+ OwnerId: number; // The roblox id of the server owner
21
+ CoOwnerIds: number[]; // The roblox ids of the server co owners
22
+ CurrentPlayers: number; // The amount of people currently in-game
23
+ MaxPlayers: number; // The amount of people who can join the server including server owner
24
+ JoinKey: string; // The code used to join the private server
25
+ AccVerifiedReq: "Disabled" | "Email" | "Phone/ID"; // The level of verification roblox accounts need to join the private server
26
+ TeamBalance: boolean; // If team balance is enabled or not
27
+ }
24
28
 
25
- export interface ServerPlayer {
26
- Player: ErlcPlayer;
27
- Permission: ErlcPlayerPermission;
28
- }
29
+ export interface ServerPlayer {
30
+ Player: ErlcPlayer;
31
+ Permission: ErlcPlayerPermission;
32
+ }
29
33
 
30
- export interface JoinLog {
31
- Join: boolean; // True is join and False is leave
32
- Timestamp: number; // Timestamp in seconds
33
- Player: ErlcPlayer;
34
- }
34
+ export interface JoinLog {
35
+ Join: boolean; // True is join and False is leave
36
+ Timestamp: number; // Timestamp in seconds
37
+ Player: ErlcPlayer;
38
+ }
35
39
 
36
- export interface KillLog {
37
- Killed: ErlcPlayer;
38
- Timestamp: number; // Timestamp in seconds
39
- Killer: ErlcPlayer;
40
- }
40
+ export interface KillLog {
41
+ Killed: ErlcPlayer;
42
+ Timestamp: number; // Timestamp in seconds
43
+ Killer: ErlcPlayer;
44
+ }
41
45
 
42
- export interface CommandLog {
43
- Player: ErlcPlayer;
44
- Timestamp: number; // Timestamp in seconds
45
- Command: string;
46
- }
46
+ export interface CommandLog {
47
+ Player: ErlcPlayer;
48
+ Timestamp: number; // Timestamp in seconds
49
+ Command: string;
50
+ }
47
51
 
48
- export interface ModcallLog {
49
- Caller: ErlcPlayer;
50
- Moderator?: ErlcPlayer; // If call is unanswered property is undefined
51
- Timestamp: number; // Timestamp in seconds
52
- }
52
+ export interface ModcallLog {
53
+ Caller: ErlcPlayer;
54
+ Moderator?: ErlcPlayer; // If call is unanswered property is undefined
55
+ Timestamp: number; // Timestamp in seconds
56
+ }
53
57
 
54
- export type ServerBan = Record<PlayerId, PlayerName>;
58
+ export type ServerBan = Record<PlayerId, PlayerName>;
55
59
 
56
- export interface VSMCommandBody {
57
- command : string; // ":h Hey everyone!"
58
- }
60
+ export interface VSMCommandBody {
61
+ command: string; // ":h Hey everyone!"
62
+ }
59
63
 
60
- export function getBans(serverToken: string): Promise<ServerBan>;
61
- export function getCommandLogs(serverToken: string): Promise<CommandLog[]>;
62
- export function getJoinLogs(serverToken: string): Promise<JoinLog[]>;
63
- export function getKillLogs(serverToken: string): Promise<KillLog[]>;
64
- export function getModcallLogs(serverToken: string): Promise<ModcallLog[]>;
65
- export function getPlayers(serverToken: string): Promise<ServerPlayer[]>;
66
- export function getQueue(serverToken: string): Promise<number[]>;
67
- export function getServer(serverToken: string): Promise<ServerStatus>;
68
- export function runCommand(serverToken: string, command: string): Promise<boolean>;
64
+ export function getBans(serverToken: string): Promise<ServerBan>;
65
+ export function getCommandLogs(serverToken: string): Promise<CommandLog[]>;
66
+ export function getJoinLogs(serverToken: string): Promise<JoinLog[]>;
67
+ export function getKillLogs(serverToken: string): Promise<KillLog[]>;
68
+ export function getModcallLogs(serverToken: string): Promise<ModcallLog[]>;
69
+ export function getPlayers(serverToken: string): Promise<ServerPlayer[]>;
70
+ export function getQueue(serverToken: string): Promise<number[]>;
71
+ export function getServer(serverToken: string): Promise<ServerStatus>;
72
+ export function runCommand(
73
+ serverToken: string,
74
+ command: string
75
+ ): Promise<boolean>;
69
76
 
70
- export class Client {
71
- constructor(options: ClientConfig)
72
- config(): ClientConfig;
73
- }
74
- }
77
+ export class Client {
78
+ constructor(options: ClientConfig);
79
+ config(): ClientConfig;
80
+ }
81
+ }