Skip to content

Commit

Permalink
Changing things
Browse files Browse the repository at this point in the history
  • Loading branch information
galaxine-senpai committed Mar 6, 2024
1 parent 0909d1b commit 6673984
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
name: ERLC JS Wrapper

on:
workflow_dispatch
release:
types: [created, edited, published]

jobs:
build:
Expand Down
5 changes: 0 additions & 5 deletions example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ const Client = new client.init({
token: 'your-token-here'
})

// Update the config
Client.getConfig()

// Now you should be able to use the client

// Lets try getting the bans from the server
Client.getServerBans().then(bans => {
"Bans: " + console.log(bans)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "erlc-js-wrapper",
"version": "1.0.0",
"version": "1.1.0",
"description": "A JavaScript wrapper for the ER:LC API",
"main": "index.js",
"scripts": {
Expand Down
23 changes: 9 additions & 14 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,38 @@ This is a simple API wrapper for the new ERLC API, this is my first NPM package

```javascript

const client = require('../index.js')
const client = require('erlc-js-wrapper')

const Client = new client.init({
token: 'your-token-here'
})

// Update the config
Client.config()

// Now you should be able to use the client

// Lets try getting the bans from the server
client.getServerBans().then(bans => {
Client.getServerBans().then(bans => {
"Bans: " + console.log(bans)
}).catch(console.error)

// How about online players next
client.getOnlinePlayers().then(players => {
Client.getOnlinePlayers().then(players => {
"Players: " + console.log(players)
}).catch(console.error)

// Lets now try the queue
client.getPlayerQueue().then(queue => {
Client.getPlayerQueue().then(queue => {
"Queue: " + console.log(queue)
}).catch(console.error)

// Now how about Kill Logs
client.getServerKL().then(killLogs => {
Client.getServerKL().then(killLogs => {
"Kill Logs: " + console.log(killLogs)
}).catch(console.error)

// Finally, lets run a command
client.runCmd(':h Hello World!').then(response => {
Client.runCmd(':h Hello World!').then(response => {
"Command: " + console.log(response)
}).catch(console.error)

console.log("All done!")

/**
* Now we are all done!
*/
```
2 changes: 1 addition & 1 deletion src/classes/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class erlcClient {
* @returns {globalConfig} - The globalConfig
*/
getConfig() {
return main.globalConfig;
console.log(main.globalConfig); // This is just for debugging purposes and really shouldn't be used in prod
}

/**
Expand Down

0 comments on commit 6673984

Please sign in to comment.