3.0.0 • Published 2 years ago

hhh-host v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

versão da lib

⚠️ Warnings

🤔 How to use

📥 Library installation

  • npm i hhh-host
  • create two files one for hhh-host and one for your bot

my-bot-example.js

const room = HBInit({});

room.onPlayerJoin = (player) => {
    room.sendAnnouncement(`Hi, ${player.name}[${player.ipv4}]`, player.id);
};

api.js

const { Server } = require("hhh-host");

const server = new Server();

/**
 * @param {string} file - Your bot file.
 * @param {string} discordToken - Your discord bot token. https://discordjs.guide/preparations/setting-up-a-bot-application.html#your-bot-s-token
 */

server.run({
    file: "my-bot-example.js",
    discordToken: "YOUR_DISCORD_TOKEN"
});

🏁 Start the script

💻 Commands

  • !send message - send a message to the haxball room
  • !clearbans - reset room bans
  • !close - close the room and disconnect the discord bot
  • !player ID - shows the information of the player who is in the room
  • !kick playerID ban reason - kick the player out of the room. ban(yes or no). Ex.: !kick 2 yes racismo na sala
  • !players - shows the players that are in the room
  • !room - show room info
  • !cmds - show all commands

🗺️ HaxBall Headless Host API

PlayerObject

...

flag : string returns player flag

ping : int returns player ping

conn : String & auth : String is now considered a global inside "PlayerObject"

join : int returns a Date.now() of the time the player entered the room

avatar : string returns player avatar

ipv4 : string returns the player's public ip

RoomObject

...

configObject : RoomConfigObject return room settings

3.0.0

2 years ago

2.0.8

2 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.5.10

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago