Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CalabazaDiscord

A small, fast, two-way bridge between PumpkinMC and Discord.

  • Pumpkin chat and events go to Discord through a webhook.
  • Discord channel messages return to Pumpkin through Discord's authenticated REST API.
  • Chat, join, leave, death, advancement, startup, and shutdown formats are configurable in TOML.
  • Event handlers are non-blocking, and Discord polling runs as a scheduled task.
  • The WebAssembly plugin requests only its private data-folder and outbound HTTP permissions.

Discord webhooks can send messages but cannot receive channel messages. The reverse direction therefore uses a bot token and channel messages endpoint. No token or webhook secret is included in this repository.

Install

  1. Download CalabazaDiscord.wasm from the latest release.
  2. Put it in Pumpkin's plugins/ directory and start Pumpkin once.
  3. Open the generated plugins/data/CalabazaDiscord/config.toml (the exact capitalization follows Pumpkin's data-folder naming).
  4. Add a Discord webhook URL for Pumpkin -> Discord.
  5. For Discord -> Pumpkin, create a bot, invite it to the channel, and add its token and the channel ID. Grant View Channel and Read Message History. Enable Message Content intent in the Discord developer portal if Discord requires it for your application.
  6. Restart Pumpkin.

The first poll records the newest Discord message without replaying old channel history. New messages are then relayed in chronological order. Messages created by bots and webhooks are ignored by default to prevent loops.

Configuration

The generated file matches config.example.toml. Available placeholders are:

Format Placeholders
chat {player}, {message}
join, leave, death {player}
advancement {player}, {advancement}
discord_chat {author}, {message}

poll_interval_ticks is clamped to at least 20 ticks (approximately one second), and max_message_length is clamped to 1-1900 characters. Discord allowed mentions are disabled in webhook payloads to prevent unwanted pings.

Build

Install Rust and the component-model WASI target, then build:

rustup target add wasm32-wasip2
cargo build --release --locked

The artifact is written to target/wasm32-wasip2/release/calabaza_discord.wasm.

The Pumpkin dependency is pinned to a known commit because Pumpkin's plugin API is still evolving. Update that revision and rebuild when targeting a newer Pumpkin server revision.

License

MIT

About

Fast two-way Discord chat and event bridge for PumpkinMC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages