# ppfun-admin-api

> Pixelplanet chat bot

Latest version **1.0.9** (published 2023-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install ppfun-admin-api
pnpm add ppfun-admin-api
yarn add ppfun-admin-api
bun add ppfun-admin-api
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2023-12-10 |
| First published | 2023-07-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 57.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Pikod |
| Maintainers | pikod |
| Keywords | pixelplanet, bot |

## Links

- npm: https://www.npmjs.com/package/ppfun-admin-api
- Repository: https://github.com/ByPikod/ppfun-admin-api
- Homepage: https://github.com/ByPikod/ppfun-admin-api#readme
- Issues: https://github.com/ByPikod/ppfun-admin-api/issues
- npm.io page: https://npm.io/package/ppfun-admin-api

## Dependencies (1)

- [ws](https://npm.io/package/ws.md) ^8.13.0

## Recent versions

- 1.0.9 (latest) — 2023-12-10
- 1.0.8 — 2023-08-27
- 1.0.7 — 2023-08-26
- 1.0.6 — 2023-08-14
- 1.0.5 — 2023-08-09
- 1.0.4 — 2023-08-03
- 1.0.3 — 2023-08-03
- 1.0.2 — 2023-08-03
- 1.0.1 — 2023-07-31
- 1.0.0 — 2023-07-28

## README

![CanvasPixel](promotion/canvaspixel.png)

# PixelPlanet Admin API

This GitHub repository contains the JavaScript API for the admin-exclusive Socket interface of pixelplanet.fun, a  multiplayer pixel placement game. With this API, you can access player data, get information about the game world, monitor changes made on the map, and perform various administrative tasks.

I developed this interface for my own PixelPlanet website, CanvasPixel.net.

You can access the official open-source repository of the PixelPlanet project from this link: 

https://git.pixelplanet.fun/ppfun

## Getting Started

First of all, you need to have your own pixelplanet.fun clone that you can connect to using this interface. If you haven't set up the pixelplanet code yet, you can access the code from the original pixelplanet.fun repository I mentioned above.

To use this API, you can follow these steps:

* Find your ecosystem.yml in your dist folder and define the config variable "APISOCKET_KEY" as you wish.
* Create your Node project and install the package with: 
  ```console
  npm i ppfun-admin-api
  ```
* Paste the example code into your "index.js" file and you are ready to go!

## Example Usage

```js
const ppfun = require("ppfun-admin-api")
const config = require("./config.json");

const bot = new ppfun.Bot();

// Notify when connected
bot.addListener("open", () => {
    console.log("Connected to the server!")
})

// Log messages
bot.addListener("chatMessage", (message) => {
    console.log(`${message.getAuthor().getName()}: ${message.getContent()}`)
})

// Connect
bot.connect(
    config.url, 
    config.apiKey, 
    ppfun.Subscriptions.CHAT
)
```

## Contributions

We welcome contributions to this project. For more information, please refer to the [Contribution Guide](https://github.com/ByPikod/canvaspixel-chatbot/wiki/Contribution)

## License

This project is licensed under the terms of the MIT License.

You are free to use this project in compliance with the MIT License. If you decide to use, modify, or redistribute this software, you must include a copy of the original license and copyright notice in all copies or substantial portions of the software.

For more information about the MIT License, visit: [MIT License](LICENSE).

---
_Source: https://npm.io/package/ppfun-admin-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
