@mushi-mushi/plugin-discord
v0.1.3
Published
Mushi Mushi plugin for Discord — posts rich embeds to an Incoming Webhook for report and fix lifecycle events.
Maintainers
Readme
@mushi-mushi/plugin-discord
Mushi Mushi plugin: post Discord embeds to an Incoming Webhook for key report lifecycle events.
Install
npm i @mushi-mushi/plugin-discordRun as a stand-alone server
MUSHI_PLUGIN_SECRET=... # set when the plugin is installed in Mushi admin
DISCORD_WEBHOOK_URL=https://discord.com/... # Incoming Webhook URL
ADMIN_BASE_URL=https://... # Mushi admin base URL (deep-links)
PORT=3000 # optional
npx mushi-plugin-discordInstall Discord Notifier in the Mushi admin Marketplace and point its
webhook_url at https://your-host/mushi/webhook.
Programmatic usage
import { createDiscordPlugin } from '@mushi-mushi/plugin-discord'
import express from 'express'
import { expressMiddleware } from '@mushi-mushi/plugin-sdk'
const handler = createDiscordPlugin({
webhookUrl: process.env.DISCORD_WEBHOOK_URL!,
adminBaseUrl: process.env.ADMIN_BASE_URL!,
mushiSecret: process.env.MUSHI_PLUGIN_SECRET!,
})
express().post('/mushi/webhook', expressMiddleware(handler)).listen(3000)Subscribed events
report.classified— embed coloured by severity (criticalred,highorange,mediumyellow,lowgreen).fix.proposed— blue embed.fix.applied— green embed.report.status_changed— grey embed with the new status.
Notes
- All webhook calls retry transient
5xxviawithRetryfrom@mushi-mushi/plugin-sdk. - Embed colour palette mirrors
_shared/discord.tsserver-side so notifications look consistent regardless of which path fires them.
License
MIT
