offline_phoenixapi
v1.0.7
Published
Phoenix API for Javascript
Downloads
2
Readme
Phoenix API
This API is used to communicate with Phoenix Bot by Hatz, inspired by Phoenix API made in C++ and Python.
There is an example of how to use this API in the repo : PhoenixAPI_Example where you have information on how to install the package as it is actually a private package hosted on Github Packages.
The main difference between this API and the ones in Python / C++ is that this one use an event listener to communicate with phoenix bot instead of a loop that check for new messages.
This event listener as stated in examples can be accessed by using the following code :
const { PhoenixAPI } = require("@offlinenos/phoenixapi");
const player = new PhoenixAPI(55000); // Port of the bot
player.phoenixPackets.on('packet', (packet) => {
// Do something with the packet
});