An open API service indexing awesome lists of open source software.

https://github.com/raclettes/rmq-discord-transport

Rust consumer for RabbitMQ that forwards data to webhooks
https://github.com/raclettes/rmq-discord-transport

discord rabbit rabbitmq rmq rmq-discord-transport rust rust-lang

Last synced: 4 months ago
JSON representation

Rust consumer for RabbitMQ that forwards data to webhooks

Awesome Lists containing this project

README

        

[![forthebadge](https://forthebadge.com/images/badges/made-with-rust.svg)](https://forthebadge.com)

# 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:[email protected]`).
- `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`](src/interface.rs). The data is taken as JSON and is expected as follows:

```jsonc
{
"webhook_uri": "", // optional
"payload": {
"content": "",
"username": "", // optional
"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": "",
"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](https://github.com/starsflower/rmq-discord-transport/issues). Any support/feedback is appreciated.