Skip to content

Commit ba5f1c8

Browse files
committed
fix: add Discord.js dependencies and activate Discord setup UI
DISCORD DEPENDENCY FIX: - Install zlib-sync@0.1.10 (required by discord.js for compression) - Install bufferutil@4.1.0 (performance optimization) - Install utf-8-validate@6.0.6 (WebSocket validation) These are optional dependencies for discord.js but required for proper functionality and performance. DISCORD UI ACTIVATION: - Import DiscordSetup component in dashboard/page.tsx - Replace 'Coming Soon' alert with fully functional DiscordSetup - Discord now has same UX flow as Telegram and WhatsApp FIXES: - Resolves 'Module not found: zlib-sync' build error - Discord messaging channel now accessible in Automation tab - Users can now set up Discord bots for receiving daily sparks
1 parent b996043 commit ba5f1c8

3 files changed

Lines changed: 27 additions & 10 deletions

File tree

bun.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"@next/third-parties": "^16.1.6",
1515
"@sentry/nextjs": "^10.38.0",
1616
"@vercel/og": "^0.8.6",
17+
"bufferutil": "^4.1.0",
1718
"daisyui": "^5.5.14",
1819
"date-fns": "^4.1.0",
1920
"discord.js": "^14.25.1",
@@ -29,7 +30,9 @@
2930
"react": "19.2.3",
3031
"react-dom": "19.2.3",
3132
"recharts": "^3.7.0",
32-
"whatsapp-web.js": "^1.34.6"
33+
"utf-8-validate": "^6.0.6",
34+
"whatsapp-web.js": "^1.34.6",
35+
"zlib-sync": "^0.1.10"
3336
},
3437
"devDependencies": {
3538
"@playwright/test": "^1.58.0",

src/app/dashboard/page.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { PartnerLink } from '@/components/PartnerLink';
1414
import { DeveloperIntegrations } from '@/components/DeveloperIntegrations';
1515
import { TelegramSetup } from '@/components/messaging/TelegramSetup';
1616
import { WhatsAppSetup } from '@/components/messaging/WhatsAppSetup';
17+
import { DiscordSetup } from '@/components/messaging/DiscordSetup';
1718
import { TIER, TIER_NAMES, LOVE_LANGUAGE_NAMES, type LoveLanguage } from '@/lib/types';
1819
import {
1920
User,
@@ -332,15 +333,15 @@ function AutomationTabContent({
332333
}}
333334
/>
334335
) : (
335-
<div className="alert alert-warning">
336-
<svg xmlns="http://www.w3.org/2000/svg" className="stroke-current shrink-0 h-6 w-6" fill="none" viewBox="0 0 24 24">
337-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
338-
</svg>
339-
<div>
340-
<h3 className="font-bold">Discord Integration Coming Soon</h3>
341-
<div className="text-xs">We're currently working on Discord support. Please use Telegram or WhatsApp for now.</div>
342-
</div>
343-
</div>
336+
<DiscordSetup
337+
userId={user?.id || ''}
338+
onSuccess={() => {
339+
setShowMessagingSetup(false);
340+
}}
341+
onError={(error) => {
342+
console.error('Discord setup error:', error);
343+
}}
344+
/>
344345
)}
345346
</div>
346347
</div>

0 commit comments

Comments
 (0)