Cover image for project: NEXUS Discord IN PROGRESS

Technical summary

NEXUS Discord connects the panel to the Discord platform through Incoming Webhooks and Bot API v10, letting you send messages, embeds and operational notifications to channels and servers. The plugin offers dual configuration (webhook or bot), delivery audit with channel caching, /discord slash commands and automatic task notifications, with credential masking and an integrated connection test.

Executed scope

  • Plugin registration in plugin.php: registerTab('discord', tab.php) with the message-square icon (Communication category), registerDoc('discord', doc.md) and 11 API actions via registerApiAction.
  • Database: MySQL tables discord_history (id, type, target, message_preview, status, http_code, response_data, task_id, created_at) and discord_cache (kind, query_key, data, status, updated_at with UNIQUE uk_kind_key) — created with CREATE TABLE IF NOT EXISTS in discord_install(); no install.sql.
  • Centralized configuration in discord_settings (via DB::getConfig): webhook_url, bot_token, application_id, default_channel_id, guild_id, bot_username, bot_avatar_url and the auto_notify_tasks/auto_notify_alerts toggles; discord_public_config() only exposes masked values (discord_mask_secret).
  • Webhook delivery (discord_send_webhook): POST with ?wait=true, content + embeds payload, per-delivery username/avatar_url, cURL timeouts (5s connect / 12s total) and full history logging.
  • Bot API v10 delivery (discord_send_bot_message): POST to /channels/{id}/messages with Authorization: Bot; hybrid mode in discord_send_message (auto mode uses the bot when channel_id + token are configured).
  • Bot lookups: discord_get_bot_info() (/users/@me) and discord_get_channels() (/guilds/{id}/channels filtering types 0, 5 and 15) with a 1-hour TTL cache (DISCORD_CACHE_TTL) to avoid rate limits.
  • Connection test (discord_test_connection): validates the webhook (Blurple test embed) and/or bot authentication, returning per-mode details.
  • Status and history: discord_status (totals, successes, errors and mode — Webhook, Bot API v10 or Hybrid), discord_history (limit 1–100) and discord_history_clear (TRUNCATE).
  • Fast Responses: fastr.json manifest with /discord (status, ping/test, send <message>) plus discord_fastr_suggest for suggestions.
  • Intel Hub: nx_intel_register_enricher('discord', ['_text'], 'discord_intel_enrich', 50) — exposes the notification channel as configured/not configured.
  • Interface (tab.php, 731 lines): 4 tabs (Send, History, Bot/Channels, Settings) with 4 KPIs (Total Deliveries, Successes, Errors, Mode) and an online/offline indicator.
  • Task auto-dispatch: discord_handle_task_event() wired into the core via webhook_async.php — automatic embeds for task.created, task.updated (start, review and completion) and task.deleted, with state-based colors, critical-priority highlight (🚨 red), direct task link (SITE_URL + /index.php?view=) and respect for the auto_notify_tasks/auto_notify_alerts toggles.
  • OAuth2 invite generator: discord_invite_url action + discord_generate_invite_url() — authorization URL with permissions 277025507392 (messages, embeds, threads, history, mentions, reactions) and bot + applications.commands scopes, updated live in the Bot/Channels tab.
  • MCP tool nexus_discord_send_message: exposed in the nexus-mcp-server (schema content/title/description/color/channel_id/task_id) calling the discord_send action via Bearer — AI agents send operational alerts directly.
  • Quick presets in the Send tab: ready-made templates (Security Incident, Deploy/Release, Daily Standup, Maintenance and Task Test) that fill the form in one click.
  • Critical CI security alerts can use the Discord webhook via notify.php (notifications.discord_webhook_url).

Stack and tools

  • PHP 8 backend (no framework) + MySQL (discord_history, discord_cache)
  • Discord API v10 (Bot) + Incoming Webhooks
  • Alpine.js + Tailwind CSS (tab with 4 tabs, KPIs and forms)
  • Internal Plugin API (PluginManager tabs/docs/actions + fastr.json + intel enricher)
  • cURL with timeouts and NEXUS API Bearer token authentication

Operational tags

  • Discord
  • Notifications
  • Webhooks
  • Bot API
  • Messages
  • Alerts
  • Communication
  • NEXUS Plugin

Operational result

  • Two delivery modes: Incoming Webhook (fast, no bot) or Bot API v10 (server channels), with automatic hybrid mode.
  • Full audit trail: every delivery records HTTP code, preview, response payload and optional task_id in discord_history.
  • Operational history: queryable with a limit and clearable via API, no data accumulation.
  • Slash commands: /discord status, /discord ping and /discord send <message> straight from the Fastr terminal.
  • Security: credentials masked in the UI and in API responses; short cURL timeouts; TTL cache to avoid rate limits.
  • Verifiable readiness: built-in connection test validates webhook and bot before production use.

GitHub progress (issues)

Real-time panel with latest repository issues.

abertas (amostra): -- fechadas (amostra): -- base: -- ultimas issues

carregando andamento...

Real results

NEXUS Discord connects the panel to the Discord platform through Incoming Webhooks and Bot API v10, letting you send messages, embeds and operational notifications to channels and servers. The plugin offers dual configuration (webhook or bot), delivery audit with channel caching, /discord slash commands and automatic task notifications, with credential masking and an integrated connection test.

Architecture and organization

Execution and operations

The project follows reproducible execution flow with technical validation in production-like environments.

Screenshots

Talk about this project

Apply this implementation pattern in your environment and accelerate delivery with technical consistency.