Code Monkey home page Code Monkey logo

synology-chat-communicator's Introduction

synology-chat-communicator

Simple wrapper to send Messages to Synology Chat

npm version license downloads Known Vulnerabilities

About

Simple wrapper to send Messages to Synology Chat

❤️ Awesome Features:

  • Out of the box simple Interface. 🔥
  • Added support for multimedia messages 🍺
  • Simple way to send direct messages to one or many users 🎉
  • Direct support to list users and channels 🔊
  • debug is supported 💪
  • Easy to use and great test coverage ✅

Installation

npm install synology-chat-communicator

Usage

Simple example

const { sendDirectMessage, getUsers, getChannels } = require('synology-chat-communicator')({
    token: '<YOUR-TOKEN>',
    baseUrl: 'https://<IP-OR-URL>:<PORT>',
    ignoreSSLErrors: true
})

;(async () => {

    const channels = await getChannels()
    console.log("channels:", channels)

    const users = await getUsers()
    console.log("users:", users)

    const user = users[0]
    const userIdsList = users.map(({user_id}) => user_id)

    const message = await sendDirectMessage(user.user_id, `Hello, ${user.username}!`)
    console.log("message:", message)

    const mediaMessage = await sendDirectMessage(user.user_id, `Check out this cool picture, ${user.username}!`, 'https://ulisesgascon.com/ulises_gascon.jpg')
    console.log("Media Message:", mediaMessage)

    const massiveMessage = await sendDirectMessage(userIdsList, "I am the new 🤖. Chat with me!")
    console.log("Massive Message:", massiveMessage)
})()

Disable SSL validation

If you have a Synology NAS with invalid SSL certificates (due to expiration or other issues), you can disable the SSL validation in the requests generated by the library by using the configuration parameter ignoreSSLErrors.

Additional Features

Please check out the official DSM Documentation to include new features

Built With

Development only:

Production only:

  • debug - Debug the app
  • got - Human-friendly and powerful HTTP request library for Node.js

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • This project is under development, but you can help us to improve it! We ❤️ FOSS!

synology-chat-communicator's People

Contributors

ulisesgascon avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.