Skip to content
This repository was archived by the owner on Dec 26, 2021. It is now read-only.
This repository was archived by the owner on Dec 26, 2021. It is now read-only.

Is there a method to send a message to all used messengers? #29

@tenorok

Description

@tenorok

For example we registered a few messengers via use-method:

const bot = new Bot({
  logLevel: "info"
});

bot.use(new BroidDiscord({...options}));
bot.use(new BroidMessenger({...options}));
bot.use(new BroidSlack({...options}));

And now we need to send message for all of these messengers:

bot.on('Person').subscribe(); // For execute `.connect()` on every integration (1)
bot.sendText('Hello World!', {
    '@context': 'https://www.w3.org/ns/activitystreams',
    generator: { ... }, // Discord
    published: 1515442064,
    type: 'Note',
    target: { id: '635580', name: 'Artem Kurbatov', type: 'Person' }
});
// And two more times for Messenger and Slack.

How we can send message to all registered messengers at one time?

P.S.: Why published property is reduced by a thousand?

(1) https://github.com/broidHQ/broid-kit/blob/master/src/core/Bot.ts#L111

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions