0.1.1 • Published 2 years ago
substreams-sink-discord v0.1.1
Substreams Discord CLI Node.js
substreams-sink-discordis a tool that allows developers to pipe data extracted from a blockchain to the Discord messaging social platform.
📖 Documentation
Further resources
Protobuf
CLI
- MacOS
- Linux
- Windows
Install globally via npm
$ npm install -g substreams-sink-discordRun
$ 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
*.spkgfrom:- Load URL or IPFS
- Read from
*.spkglocal filesystem - Read from
substreams.yamllocal filesystem
- Handle
cursorrestart
Discord
- Handle rate limit
- Markdown message parsing
- Embed message support