Stores chat messages in daily archive files
Go to file
Râu Cao 929188bc2b
All checks were successful
continuous-integration/drone/push Build is passing
2.1.1
2022-08-12 16:08:34 +01:00
dist 2.1.1 2022-08-12 16:08:34 +01:00
src Fix updating of archive meta document 2022-08-11 10:41:48 +01:00
tests Remove extra newline 2022-08-11 11:11:56 +01:00
.drone.yml Add Drone config 2022-08-11 10:38:20 +01:00
.gitignore Port source from legacy module repo 2017-05-03 18:42:26 +02:00
.jshintrc Port source from legacy module repo 2017-05-03 18:42:26 +02:00
package-lock.json 2.1.1 2022-08-12 16:08:34 +01:00
package.json 2.1.1 2022-08-12 16:08:34 +01:00
README.md Update badge link 2021-09-13 14:31:04 +02:00
webpack.config.js Fix build config to work with node.js 2021-09-13 13:16:40 +02:00

Release

remoteStorage Module: Chat Messages

Stores chat messages in daily archive documents.

Usage

Open a daily archive and write messages to it:

const RemoteStorage = require("remotestoragejs");
const ChatMessages  = require("remotestorage-module-chat-messages");
const remoteStorage = new RemoteStorage({ modules: [ ChatMessages ] });

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
});

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?" }
];

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.

Support, bugs, feedback, questions

Come and chat with us: https://wiki.kosmos.org/Main_Page#Chat