substreams-sink-discord
v0.1.1
Published
Substreams discord sink module
Downloads
3
Maintainers
Readme
Substreams
Discord CLI Node.js
substreams-sink-discord
is a tool that allows developers to pipe data extracted from a blockchain to the Discord messaging social platform.
📖 Documentation
Further resources
Protobuf
CLI
- [x] MacOS
- [x] Linux
- [x] Windows
Install globally via npm
$ npm install -g substreams-sink-discord
Run
$ substreams-sink-discord run [options] <spkg>
Formatting
Supports JSON
and YAML
format for configuration file. Example of config.json
format configuration file:
[
{
"entity": "Transfer",
"type": "channel",
"tts": true,
"chat_ids": [
"1098279427617603636"
],
"message": "Hello channel! This **{user_id}** made a __transaction__ with id `{trx_id}`"
},
{
"entity": "Transfer",
"type": "user",
"chat_ids": [
"969082968410816632"
],
"message": "Hello user! This **{user_id}** made a __transaction__ with id `{trx_id}`"
},
{
"entity": "Grant",
"chat_ids": [
"1098279427617603636"
],
"message": "This ||{grant}||",
"embed": {
"title": "Embed message title {user_id}",
"description": "Embed message description {user_id}"
}
}
]
Text between {}
are field names and are used as labels for message templating. In the example above, all EntityChanges
messages coming from the substream with entity
key having Transfer
as value, will be sent to Discord channel or thread with id 1098279427617603636
, as specified in the first json object.
Features
Substreams
- Consume
*.spkg
from:- [x] Load URL or IPFS
- [ ] Read from
*.spkg
local filesystem - [ ] Read from
substreams.yaml
local filesystem
- [x] Handle
cursor
restart
Discord
- [x] Handle rate limit
- [x] Markdown message parsing
- [x] Embed message support