1.0.1 • Published 4 years ago

pilotcity-client v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

This is a client for pilotcity's api

Usage

// create a client
const GroupChatClient = require('../index')

async function main() {
    // initialize a client
    const client = new GroupChatClient("http://localhost:8080", 'kura');
    // callback for receiving a message
    client.OnRecv(data => {
        // if (data.sender != me)
        console.log(data);
    })
    // send a message
    client.sendMessage({
        sender: 'AVERYCOOLUID01',
        timestamp: Date.now(),
        text:  `emoji should be supported 🙄`
    });
    console.log("sent!");
    const data = await client.getList();
    console.log(data)
}

main();