post-chatwork-message

1.0.1 • Public • Published

post-chatwork-message

Post a message to a room of the Chatwork. / Chatworkにメッセージを投稿します。

This function will return a Promise. / Promiseを返します。

Usage

Exapmle / 実行例

const apiToken = 'AAA'
const roomId = '1234'
 
postChatworkMessage(apiToken, roomId, 'hello world')

Parameters

Name Type Description
apiToken string Chatwork API Token. see 認証方法 - チャットワークAPIドキュメント.
roomId string An Id of the room of the Chatwork. Remember a #!rid is excluded.
message string A message to send.

Setup

npm install post-chatwork-message

Exapmle / 実行例

const postChatworkMessage = require('post-chatwork-message')
const APIKey = 'AAA'
const roomId = '1234'
 
postChatworkMessage(APIKey, roomId, 'hello world')

For development

Test

mocha is used to test. / mochaを使います。

Prepare secrets for Chatwork in token.json. / Chatworkへの接続情報を書いたtoken.jsonファイルを用意します。

echo '{"token":"YOUR_TOKEN", "roomId":"YOUR_ROOM"}' > token.json
npm test

Deploy

npm version patch
npm publish

Reference

エンドポイント /rooms - チャットワークAPIドキュメント

Package Sidebar

Install

npm i post-chatwork-message

Weekly Downloads

37

Version

1.0.1

License

MIT

Unpacked Size

3.19 kB

Total Files

3

Last publish

Collaborators

  • ledsun