From 188b45e7781b3e84439b8d11d8235802b84476f4 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Mon, 13 Sep 2021 14:02:31 +0200 Subject: [PATCH] Add proper README * Document usage * Update communication options for support/issues --- README.md | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1a078cd..7e4c3e8 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,37 @@ Stores chat messages in daily archive documents. -Please feel free to open GitHub issues for questions, feature requests, -protocol proposals, and whatever else you like. +## Usage -## Protocols +Open a daily archive and write messages to it: -### Currently supported +```js +const RemoteStorage = require("remotestoragejs"); +const ChatMessages = require("remotestorage-module-chat-messages"); +const remoteStorage = new RemoteStorage({ modules: [ ChatMessages ] }); -* IRC -* XMPP +const archive = new remoteStorage.chatMessages.DailyArchive({ + service: { + protocol: 'IRC', + domain: 'irc.libera.chat' + }, + channelName: '#kosmos', + date: new Date(), + isPublic: true // Channel logs will be written to public folder +}); -### Planned +const messages = [ + { "date": "2015-06-05T17:35:28.454Z", "user": "jimmy", "text": "knock knock" }, + { "date": "2015-06-05T17:36:05.123Z", "user": "walter", "text": "who's there?" } +]; -* Mattermost -* Matrix -* Slack -* ... +archive.addMessages(messages); +``` + +See the inline source code documentation (JSDoc) for usage details and function +arguments. For a real-world integration example, see +[hubot-remotestorage-logger](https://github.com/67P/hubot-remotestorage-logger/). + +## Support, bugs, feedback, questions + +Come and chat with us: https://wiki.kosmos.org/Main_Page#Chat