MythEclipse d55b56c897 feat(moderation): enhance message capture and storage with thread support
- Added functions to retrieve message location, sticker metadata, and display content in messageCapture.ts.
- Updated captureMessage function to store thread information and sticker metadata in the database.
- Modified messageStore.ts to support querying messages and attachments by thread ID.
- Updated types.ts to include thread_id in AttachmentRecord.
- Altered database schema in muxer-queue.ts to add thread_id column to attachments.
- Introduced ChannelSummary interface and listWatchableChannels method in voiceController.ts to fetch watchable channels.
- Added API endpoint in webserver.ts to retrieve channels for a given guild.
2026-05-13 20:52:37 +07:00
2026-05-13 15:28:25 +07:00
2026-05-12 19:38:23 +07:00

🎙️ Discord Voice Recorder Bot

Bot Discord yang otomatis join ke voice channel saat startup dan merekam suara semua pengguna yang bicara. File audio disimpan secara lokal dalam format .ogg.

Dibangun dengan Bun + discord.js + @discordjs/voice.


📋 Prasyarat

  • Bun >= 1.0
  • FFmpeg (untuk encoding audio)
    # Ubuntu/Debian
    sudo apt install ffmpeg
    
    # Arch
    sudo pacman -S ffmpeg
    
  • Discord Bot dengan permission:
    • Connect (join voice channel)
    • Use Voice Activity
    • Read Messages/View Channels
    • Privileged Intents: Server Members Intent (aktifkan di Developer Portal)

⚙️ Setup

1. Clone & Install

cd /path/to/bot
bun install

2. Konfigurasi .env

cp .env.example .env

Edit .env:

DISCORD_TOKEN=your_bot_token_here
VOICE_CHANNEL_ID=your_voice_channel_id_here
GUILD_ID=your_guild_id_here
RECORDINGS_DIR=./recordings

Cara mendapatkan ID:

  • Aktifkan Developer Mode di Discord (Settings → Advanced → Developer Mode)
  • Klik kanan pada voice channel → Copy Channel ID → paste ke VOICE_CHANNEL_ID
  • Klik kanan pada server/guild → Copy Server ID → paste ke GUILD_ID
  • Token bot dari Discord Developer Portal → Bot → Reset Token

3. Invite Bot ke Server

Di Developer Portal → OAuth2 → URL Generator:

  • Scopes: bot
  • Bot Permissions: Connect, Use Voice Activity, View Channels

Copy URL, buka di browser, pilih server.


🚀 Menjalankan Bot

# Development (auto-restart saat file berubah)
bun run dev

# Production
bun run start

Bot akan langsung join ke voice channel yang ditentukan dalam .env.


📁 Struktur File Rekaman

recordings/
  ├── 123456789-1709900000000.ogg   # <user-id>-<timestamp>.ogg
  ├── 987654321-1709900001234.ogg
  └── ...

Setiap kali user bicara dan berhenti (>1 detik diam), satu file .ogg baru dibuat.


📁 Struktur Proyek

bot/
├── src/
│   ├── index.ts       # Entry point — login & auto-join
│   └── recorder.ts    # Core recording logic
├── recordings/        # File audio tersimpan (otomatis dibuat)
├── .env               # Konfigurasi (buat dari .env.example)
├── .env.example
├── package.json
└── tsconfig.json
Description
No description provided
Readme 16 MiB
Languages
Squirrel 96.6%
TypeScript 3.3%