1.2.0 • Published 3 years ago

imperichat-js v1.2.0

Weekly downloads
1
License
UNLICENSED
Repository
github
Last release
3 years ago

Imperichat JS

Library for writing Imperichat Bots in JS!

Installation

npm i imperichat-js

Getting Started

You're going to need Node.js running in a trusted environment to use this library.

First, require the module like so:

const {ImperichatClient} = require('imperichat-js')

Then, initialize the client:

const client = new ImperichatClient()

client.login("myBotId","supersecretpassword")

client.onMessage('1234sectionid',function (message) { 
    if (message.content==="Hello"){
        client.sendMessage('1234sectionid',"World!").then(function (messageId) {
            console.log(`Message sent with ID ${messageId}`)
      })
    }
 })

To change bots within code:

client.logout();

client.login("myNewBotId", "supersecretotherpassword")
1.2.0

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago