@sheilim/shimli-sdk
Advanced tools
Comparing version 1.0.0 to 1.0.1
10
index.js
const axios = require('axios'); | ||
let config = {} | ||
function connectShimli(url, json){ | ||
@@ -24,3 +24,3 @@ return new Promise((resolve, reject) => { | ||
error: true, | ||
txt: error | ||
message: error | ||
}) | ||
@@ -31,5 +31,5 @@ }); | ||
module.export = { | ||
config: {}, | ||
sendMessage: (type, body, to, instance, caption = null, lat = null, lng = null) => { | ||
module.exports = { | ||
config: config, | ||
sendMessage: (type, body, to, instance, caption = null, filename = null,lat = null, lng = null) => { | ||
return new Promise(async (resolve, reject) => { | ||
@@ -36,0 +36,0 @@ if(!config.token){ |
{ | ||
"name": "@sheilim/shimli-sdk", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "SDK for Shimli", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# shimli-sdk | ||
Use of the Shimli api to send and read messages from the channels available in Shimli (WhatsApp, SMS, Telegram, Facebook Messanger and Instagram) | ||
Link: <https://www.shimli.app> | ||
# Installation | ||
`npm i @sheilim/shimli-sdk --save` | ||
## How is it used? | ||
``` | ||
const shimli = require('@sheilim/shimli-sdk); | ||
(function(){ | ||
shimli.config['token'] = "YOUR_TOKEN"; | ||
const result = shimli.sendMessage("chat", "Hi!! 👋", "14243962506", "ID_INSTANCE"); | ||
if(result.error) | ||
console.log(result.message); | ||
else | ||
console.log(result); | ||
})(); | ||
``` | ||
## Options | ||
* *type* - _string_ I could be chat, image, video, audio, location, document, sticker, gif | ||
* *body* - _string_ Message text or url of the media file to send | ||
* *to* - _string_ WhatsApp number to which the message will be sent | ||
* *instance* - _string_ Id of the instance connected to Shimli | ||
* *caption* - _string_ (optional) Image or video caption | ||
* *filename* - _string_ (optional) Name of the document to send | ||
* *lat* - _string_ Required if it is of type location | ||
* *lng* - _string_ Required if it is of type location |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3419
59
34