Skip to content

raclettes/rmq-discord-transport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

forthebadge

RMQ Discord Transport

rmq-discord-transport is a simple consumer for RabbitMQ that relays information to Discord, in a situation where the result is unimportant, or an isolated worker is instead wanted.

Configuration

The script takes 2 environment variables into account:

  • RABBITMQ_URI: required, defines the rabbitmq connection string (for example, amqp://guest:guest@127.0.0.1).
  • DEFAULT_WEBHOOK_URI: optional, is only needed to supply a default webhook link to use when one is not provided.

Data format

Definitions can be found in src/interface.rs. The data is taken as JSON and is expected as follows:

{
    "webhook_uri": "<webhook uri>", // optional
    "payload": {
        "content": "<message content>",
        "username": "<username>", // optional
        "avatar_url": "<avatar_url>", // optional
        "tts": true, // optional
        "embeds": {
            // See https://birdie0.github.io/discord-webhooks-guide/structure/embeds.html
            // These are not internally parsed, so there is no verification of their validity.
            // Any incorrect embeds will simply not be handled.
        }
    },
    "files": [
        {
            "filename": "<file name>",
            "is_spoiler": true, // optional
            "data": [
                /* Data as an array of u8 integers */
            ]
        },
    ]
}

Build

Build with cargo: cargo build. More info: https://doc.rust-lang.org/cargo/commands/cargo-build.html

Issues

Create an issue on the issues tab. Any support/feedback is appreciated.

Releases

No releases published

Packages

No packages published

Languages