Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saumyasinghal747/imperichat-js
Javascript SDK for the Imperichat API.
https://github.com/saumyasinghal747/imperichat-js
api bot imperichat js sdk-javascript sdk-js
Last synced: 5 days ago
JSON representation
Javascript SDK for the Imperichat API.
- Host: GitHub
- URL: https://github.com/saumyasinghal747/imperichat-js
- Owner: saumyasinghal747
- Created: 2020-10-13T20:33:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-07T02:05:25.000Z (over 3 years ago)
- Last Synced: 2024-09-25T19:01:13.018Z (8 days ago)
- Topics: api, bot, imperichat, js, sdk-javascript, sdk-js
- Language: TypeScript
- Homepage:
- Size: 143 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Imperichat JS
Library for writing Imperichat Bots in JS!
## Installation
```shell script
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:
```javascript 1.8
const {ImperichatClient} = require('imperichat-js')
```Then, initialize the client:
```javascript
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:
```javascript 1.8
client.logout();client.login("myNewBotId", "supersecretotherpassword")
```