TediCross icon indicating copy to clipboard operation
TediCross copied to clipboard

Hooks

Open Suppen opened this issue 7 years ago • 1 comments

Implement some way to hook into the bot's operations, like bot.on("telegram.messageReceived", (message, bridge) => ...), so people can write extensions to it

Suppen avatar Jun 07 '18 18:06 Suppen

In order for this to work well with the requested use-case of chat moderation, I think we might want to combine this hooks idea with the idea of a general, platform-independent API to get content from any platform.

So that bot.on('text', ...) would apply to messages from both Telegram and Discord.

If we manage to do this, we can:

  • Make message-passing between platforms way cleaner
  • Have each platform provide an emitter that matches the API spec we decide on
  • Easily add new platforms
  • Easily add plugins that will work for multiple platforms (consuming the emitter API)

trgwii avatar Jun 08 '18 08:06 trgwii