Developers Writing a plugin

Live boards

A command's answer can stay in a channel and update itself, like a leaderboard that's always current. You declare one field; BedrockRelay does the rest.

Declaring one

Add board to a command: { every: 30 } for every 30 minutes (1 to 1,440), or true for every 10.

{
  name: "top",
  description: "The top ten players by playtime",
  public: true,
  board: { every: 10 },
  run(args, context) {
    return { embed: { title: "Most played", description: topTen() } };
  },
}

Discord then shows a live option on the command. live: True posts the answer as the bot's own message in that channel and edits it every every minutes, running your command again each time. Pack v0.4.0.

How boards behave

  • Anyone allowed to use the command can start one, one per channel for each command and options. A world can have up to 10.
  • The owner can also post one from the dashboard, once or live, choosing the options there, and can change how often it updates.
  • Deleting the message in Discord stops the board.
  • While the world is offline, the plugin is switched off or no answer comes, the message keeps its last answer and the board waits.
  • Each refresh calls run() with context.live set to true, requestedBy "BedrockRelay" and linkedPlayer null.

Making a good board

  • Return an embed, and keep it the same shape each time, so the message doesn't jump about when it updates.
  • Don't depend on who asked: nobody did. If your command defaults to context.linkedPlayer, show something for everyone when context.live is set.
  • A board can't be a command with confirm: there's nobody to ask. BedrockRelay leaves board off such a command.
  • Make it public. A board is posted for everyone in the channel either way, so only use it for answers meant to be shared.
  • Drawn pictures don't show on boards yet.

Running a Minecraft world rather than building for one? The help covers everything from setup to troubleshooting.

Read the help