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 themessage-squareicon (Communication category),registerDoc('discord', doc.md)and 11 API actions viaregisterApiAction. - Database: MySQL tables
discord_history(id, type, target, message_preview, status, http_code, response_data, task_id, created_at) anddiscord_cache(kind, query_key, data, status, updated_at with UNIQUEuk_kind_key) — created withCREATE TABLE IF NOT EXISTSindiscord_install(); no install.sql. - Centralized configuration in
discord_settings(viaDB::getConfig): webhook_url, bot_token, application_id, default_channel_id, guild_id, bot_username, bot_avatar_url and theauto_notify_tasks/auto_notify_alertstoggles;discord_public_config()only exposes masked values (discord_mask_secret). - Webhook delivery (
discord_send_webhook): POST with?wait=true, content + embeds payload, per-deliveryusername/avatar_url, cURL timeouts (5s connect / 12s total) and full history logging. - Bot API v10 delivery (
discord_send_bot_message): POST to/channels/{id}/messageswithAuthorization: Bot; hybrid mode indiscord_send_message(automode uses the bot when channel_id + token are configured). - Bot lookups:
discord_get_bot_info()(/users/@me) anddiscord_get_channels()(/guilds/{id}/channelsfiltering 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) anddiscord_history_clear(TRUNCATE). - Fast Responses:
fastr.jsonmanifest with/discord(status,ping/test,send <message>) plusdiscord_fastr_suggestfor 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 viawebhook_async.php— automatic embeds fortask.created,task.updated(start, review and completion) andtask.deleted, with state-based colors, critical-priority highlight (🚨 red), direct task link (SITE_URL+/index.php?view=) and respect for theauto_notify_tasks/auto_notify_alertstoggles. - OAuth2 invite generator:
discord_invite_urlaction +discord_generate_invite_url()— authorization URL with permissions 277025507392 (messages, embeds, threads, history, mentions, reactions) andbot+applications.commandsscopes, updated live in the Bot/Channels tab. - MCP tool
nexus_discord_send_message: exposed in thenexus-mcp-server(schema content/title/description/color/channel_id/task_id) calling thediscord_sendaction 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 pingand/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.
live feed
open issues on GitHubcarregando andamento...
não foi possivel carregar as issues agora. abra no github pelo link acima.
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
- PHP 8
- MySQL
- Alpine.js
- Tailwind CSS
- Discord API v10
- Plugin NEXUS
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.