0.3.1 • Published 5 years ago

fastify-dingtalk-robot v0.3.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

fastify-dingtalk-robot

Fastify plugin for dingtalk robot.

NPM version

Install

npm i fastify-dingtalk-robot --save

Usage

'use strict'

const fastify = require('fastify')()
fastify.register(require('fastify-dingtalk-robot'), {
  accessToken: 'xxxxxxxxx',
  secret: 'SECxxxxxx'
})
const { dingtalkRobot } = fastify
const textContent = {
  msgtype: 'text',
  text: {
    content: '我就是我, 是不一样的烟火'
  },
  at: {
    atMobiles: [
      '156xxxx8827',
      '189xxxx8325'
    ],
    isAtAll: false
  }
}
dingtalkRobot.send(textContent)
  .then((res) => {
  // TODO
  })

More Usage