[Notification Center] - Plugin Telegram
Closed this issue · 2 comments
Header
Name of the task: Plugin Telegram
Name of the module: Notification center
Difficulty: 3
Waiting for: #39
Body
Short description
Now that we have a server that is consumed by our "watcher module" and received notification orders, we need to do these orders. The aim of this task is to create an open-source plugin for our notification center that will be in charge to send a notification on Telegram.
Full description
Develop a simple open-source project that can be imported into the server developed in #39 to send Telegram notifications. This plugin will be called by the server each time to_type
is equal to telegram
.
The plugin will receive these parameters:
type PluginParameters = {
to: string, // define the handle that will receive the notification
message: string, // define the message to send
}
All the secrets that the plugin will need must be passed during the initialization of the plugin.
The plugin must have two exposed methods:
init(...)
used to init the plugin. Parameters are configuration and secrets neededasync send(to: string, message: string)
used to send a notification.
The send function must return the HTTP status of the API call to Telegram.
pnpm
must be used as a dependency manager. A .nvmrc
must be set to the LTS version of node. You can decide if you want to use a library to ommunicate with Telegram and which ones but please, keep the code simple and the dependencies list as small as possible. Everything must be tested, prettied, eslinted and the README of the repository should describe the plugin.
Keep in mind the plugin will be an npm package.
Additionals ressources
Task monitoring 📝
This is an automatic post that is intended to facilitate the follow-up of the project.
This post is meant to be edited throughout the life of the project.
done by LedgerHQ/notification-center#1