English
Voicecord is a lightweight, resource-optimized Node.js script designed to maintain a persistent connection to a Discord voice channel.
Unlike standard bot implementations, this daemon is engineered for high-population environments (servers with 100,000+ members). It employs a minimalist architecture with aggressive memory management, ensuring the process remains stable on low-spec hardware.
- Minimalist Client: Initializes Discord client with
patchVoice: trueandcheckUpdate: falsefor a lean footprint. - Keep-Alive Mechanism: Streams continuous silent Opus frames (
0xf8, 0xff, 0xfe) to prevent the "Assume Active" timeout. - Fault Tolerance:
- Implements race-condition recovery (Signalling vs Connecting) with 5s timeout.
- Includes Watchdog routine (60s interval) to enforce channel presence.
- Exponential backoff retry (1s → 60s max).
- Zero-Dependency Setup: Includes an interactive CLI wizard for generating the
.envconfiguration file.
- Node.js: v16.9.0 or newer.
- Network: Stable internet connection (UDP output allowed).
-
Clone the repository:
git clone https://github.com/Mikofoxie/Voicecord.git cd Voicecord -
Install dependencies:
npm install
The application requires environment variables to function.
Run the script directly. It will detect missing configurations and prompt you for input via the CLI.
npm startCreate a .env file in the root directory:
TOKEN=your_user_token
GUILD_ID=target_server_id
CHANNEL_ID=target_voice_channel_idTo run the daemon in the current session:
npm startor
node index.jsFor 24/7 operation, using a process manager like PM2 is recommended to handle auto-restarts and logging.
npm install pm2 -g
pm2 start index.js --name "voicecord"
pm2 save
pm2 startupThe daemon operates on a single-threaded event loop.
- Initialization: Loads environment variables and initializes the Discord client with
patchVoice: true. - Connection: Establishes a voice connection with
selfMute: trueandselfDeaf: false. - Stream: Creates a readable stream pushing silence frames via
AudioPlayer. - Recovery: If the
VoiceConnectionStatustransitions toDisconnected, the system attempts a race-condition recovery (Signalling vs Connecting, 5s timeout) before initiating exponential backoff retry.
This software automates a user account ("selfbotting"), which is against the Discord Terms of Service. This tool is provided for educational and research purposes only. The author assumes no responsibility for any account suspensions or bans resulting from its use.
Tiếng Việt
Voicecord là một script Node.js nhẹ, được tối ưu tài nguyên, thiết kế để duy trì kết nối liên tục tới kênh thoại Discord.
Khác với các triển khai bot thông thường, daemon này được thiết kế cho môi trường đông đúc (máy chủ có hơn 100,000 thành viên). Nó sử dụng kiến trúc tối giản với quản lý bộ nhớ quyết liệt, đảm bảo tiến trình hoạt động ổn định trên phần cứng cấu hình thấp.
- Client Tối giản: Khởi tạo Discord client với
patchVoice: truevàcheckUpdate: falseđể giữ footprint nhẹ nhàng. - Cơ chế Keep-Alive: Stream liên tục các khung im lặng Opus (
0xf8, 0xff, 0xfe) để ngăn timeout "Assume Active". - Khả năng Chịu lỗi:
- Triển khai khôi phục race-condition (Signalling vs Connecting) với timeout 5 giây.
- Bao gồm Watchdog routine (khoảng cách 60 giây) để đảm bảo sự hiện diện trong kênh.
- Exponential backoff retry (1 giây → tối đa 60 giây).
- Thiết lập Không Phụ thuộc: Bao gồm trình hướng dẫn CLI tương tác để tạo file cấu hình
.env.
- Node.js: v16.9.0 hoặc mới hơn.
- Mạng: Kết nối internet ổn định (cho phép đầu ra UDP).
-
Clone repository:
git clone https://github.com/Mikofoxie/Voicecord.git cd Voicecord -
Cài đặt các dependency:
npm install
Ứng dụng yêu cầu các biến môi trường để hoạt động.
Chạy script trực tiếp. Nó sẽ phát hiện các cấu hình thiếu và yêu cầu bạn nhập thông tin qua CLI.
npm startTạo file .env trong thư mục gốc:
TOKEN=your_user_token
GUILD_ID=target_server_id
CHANNEL_ID=target_voice_channel_idĐể chạy daemon trong phiên hiện tại:
npm starthoặc
node index.jsĐể vận hành 24/7, khuyến nghị sử dụng trình quản lý tiến trình như PM2 để xử lý tự động khởi động lại và ghi log.
npm install pm2 -g
pm2 start index.js --name "voicecord"
pm2 save
pm2 startupDaemon hoạt động trên vòng lặp sự kiện đơn luồng.
- Khởi tạo: Tải các biến môi trường và khởi tạo Discord client với
patchVoice: true. - Kết nối: Thiết lập kết nối thoại với
selfMute: truevàselfDeaf: false. - Luồng: Tạo readable stream đẩy các khung im lặng qua
AudioPlayer. - Khôi phục: Nếu
VoiceConnectionStatuschuyển sangDisconnected, hệ thống cố gắng khôi phục race-condition (Signalling vs Connecting, timeout 5 giây) trước khi bắt đầu exponential backoff retry.
Phần mềm này tự động hóa tài khoản người dùng ("selfbotting"), điều này vi phạm Điều khoản Dịch vụ của Discord. Công cụ này được cung cấp chỉ cho mục đích giáo dục và nghiên cứu. Tác giả không chịu trách nhiệm cho bất kỳ việc đình chỉ hoặc cấm tài khoản nào do sử dụng nó.