This is a JavaScript client for interacting with the Game Jolt site API and chat.
Pull requests are also welcome. If you find any issues please open a new issue here.
This requires node 4.4.7
or later.
Below is a simple example for demonstrating the client setup:
// Authentication credentials
const username = require('./auth.json').username;
const password = require('./auth.json').password;
const client = new GameJolt.Client();
// Chat Connection
client.on('connected', data => {
console.log(`Connected to chat as ${data.username}!`);
// Enter Lobby room
client.chat.enterRoom(GameJolt.PublicRooms.lobby);
});
// Game Jolt Login
client.login(username, password).then(result => {});
Below is another example to demonstrate message events:
// Message event
client.on('message', message => {
if (message.toString() === 'ping') {
message.reply('pong');
}
// Is the client user mentioned
if (message.isMentioned) {
message.reply(`Hello ${message.user.username}!`);
}
});
If you need help or have any questions,
then please contact me at [email protected]
.