尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
An English-language, modular Discord bot for Mellune. It uses Node.js, JavaScript, discord.js 14, Prisma and Supabase Postgres. The project is split into small files so it is easy to learn and extend.
• Node.js 18.18 or newer
• A Discord server where you have Manage Server
• A Discord application and bot
• A free Supabase project檢視完整 README ↗An English-language, modular Discord bot for Mellune. It uses Node.js, JavaScript, discord.js 14, Prisma and Supabase Postgres. The project is split into small files so it is easy to learn and extend.
git clone <your-repository-url>
cd Mellune-BOT
npm install
cp .env.example .env
DISCORD_TOKEN.DISCORD_CLIENT_ID.bot and applications.commands scopes.DEV_GUILD_ID.The code requests Guilds, GuildMembers, GuildMessages, MessageContent, and GuildVoiceStates.
The bot is linked to the existing project Mellune DB:
https://qjhvapvcbyabbsgvoley.supabase.coeu-west-1The Mellune tables (guilds, warnings, tickets, levels, …) are already created there, with Row Level Security enabled so the public anon key cannot read bot data. Prisma talks to Postgres with the database password.
Prisma uses only DATABASE_URL. Put your external PostgreSQL URL there (postgresql://...). You do not need SQLite, and you do not need to add DIRECT_URL to start the bot.
DISCORD_TOKEN=your_bot_token
DISCORD_CLIENT_ID=your_application_id
DEV_GUILD_ID=your_test_server_id
SUPABASE_PROJECT_REF=qjhvapvcbyabbsgvoley
SUPABASE_URL=https://qjhvapvcbyabbsgvoley.supabase.co
SUPABASE_ANON_KEY=your_anon_or_publishable_key
DATABASE_URL="postgresql://USER:PASSWORD@HOST:5432/DATABASE"
Never share these values, and never commit .env.
npm start generates Prisma and applies any pending migrations before starting
the bot. This keeps new dashboard features, such as always-on voice, in sync
with the production database. Do not skip prisma migrate deploy when a new
migration has been added.
npm start
On startup Mellune pushes slash commands once, globally, and removes per-server copies so Discord does not show them twice. In Discord, run /ping.
For development with automatic restart:
npm run dev
Global commands (slow to appear):
npm run deploy:global
index.js/ping and /profile/warn, /warnings, /clearwarns, /timeout, /purge/setupnpm test
npm run lint
npx prettier --check .
The repository now contains a Next.js dashboard at the root alongside the
Discord bot. The bot entry point remains index.js; main.js is not used.
For local dashboard development:
npm run dashboard:dev
Production build and start:
npm run dashboard:build
npm run dashboard:start
The dashboard keeps Discord OAuth access tokens server-side in the
DashboardSession PostgreSQL table. The browser receives only an opaque,
HTTP-only session cookie. Add these server-only variables before enabling
Discord login:
DISCORD_CLIENT_SECRET=
DISCORD_REDIRECT_URI=https://your-dashboard-domain.example/api/auth/callback
SESSION_SECRET=
MELLUNE_GUILD_ID=your_mellune_server_id
MELLUNE_OWNER_ROLE_ID=your_mellune_owner_role_id
SESSION_SECRET must be at least 32 characters. The dashboard only returns
guilds the authenticated Discord user owns or can manage, and every guild
overview request re-checks that permission against Discord.
The OAuth flow also requests guilds.join: after explicit Discord consent, it
adds the authenticated user to MELLUNE_GUILD_ID using the server-side bot
token, then checks that the member has MELLUNE_OWNER_ROLE_ID before creating
a dashboard session. The bot must already be installed in that server and be
able to view members. Never expose the bot token to the browser.
The sidebar groups every module. These pages are wired to the bot and database:
guildMemberAdd / guildMemberRemove events. Placeholders: {user}, {username}, {server}, {memberCount}, {userId}./profile.Other sections show a "being built" page until the bot supports them. Icons come from lucide-react.
Missing environment variables: copy .env.example to .env and fill DISCORD_TOKEN, DISCORD_CLIENT_ID, and DATABASE_URL (a postgresql:// URL). DEV_GUILD_ID is required by npm run deploy:guild.
Commands are stale or appear twice: restart the bot. It publishes the current commands directly to each server, which updates immediately, and clears the old global list. Fully restart the Discord app once so it drops the previous global cache.
Can't reach database / IPv6 errors: use the pooler URLs from Connect, not the direct db.<project>.supabase.co host, unless your network supports IPv6.
Prisma says the URL must start with file:: the schema is still SQLite. Update the files so prisma/schema.prisma has provider = "postgresql", then run npx prisma generate.
Wrong password: reset the database password in your Postgres host, then update DATABASE_URL only.