Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.
/ gamejolt.js Public archive

[DEPRECATED]⚡This is a client for interacting with the Game Jolt site API and chat.

License

Notifications You must be signed in to change notification settings

ttbowen/gamejolt.js

Repository files navigation

Game Jolt.js

Build Status Coverage Status

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.

Installation

This requires node 4.4.7 or later.

Examples

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}!`);
  }
});

Help

If you need help or have any questions, then please contact me at [email protected].

About

[DEPRECATED]⚡This is a client for interacting with the Game Jolt site API and chat.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published