This is a Discord bot that joins a voice channel, listens to the conversation, and posts transcriptions or translations in a selected text channel using OpenAI's Whisper API.
Current version: v1.1.2
- Joins a voice channel and listens to conversations.
- Transcribes audio using OpenAI's Whisper API.
- Translates transcriptions to a selected language using OpenAI's models.
- Posts transcriptions or translations in a selected text channel.
- Allows users to select the text channel using buttons or commands.
- Provides a settings menu to configure transcription and translation parameters.
- Supports command-based configuration for ease of use.
- Node.js and npm installed
- Discord bot token
- OpenAI API key
-
Clone the repository:
git clone https://github.com/lissizza/discord-js-subtitle-bot.git cd discord-js-subtitle-bot
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory of the project and add your Discord bot token and OpenAI API key:DISCORD_TOKEN=your_discord_token OPENAI_API_KEY=your_openai_api_key
-
Start the bot with a specified text channel (optional):
npm start your_channel_name
If no channel is specified, the bot will post messages in the
#general
channel.
!menu
: Displays the main menu with options to join, leave, change the text channel, and access settings.!join
: Joins the voice channel.!leave
: Leaves the voice channel.!set_text_channel
: Displays buttons to select a new text channel for transcriptions.!settings
: Displays the settings menu to configure transcription parameters.!transcribe
: Switches the bot to transcription mode.!translate <lang>
: Switches the bot to translation mode and sets the target language to<lang>
. If<lang>
is not provided, a language selection menu is displayed.
- Join: Joins the voice channel.
- Leave: Leaves the voice channel.
- Change Text Channel: Displays buttons to select a new text channel for transcriptions.
- Settings: Displays the settings menu to configure transcription parameters.
- Minimal Speech Duration: Configures the minimum duration of speech to be transcribed.
- Sample Rate: Configures the audio sample rate.
- Audio Channels Count: Configures the number of audio channels.
- Silence Duration: Configures the duration of silence to end the recording.
- Whisper Temperature: Configures the temperature parameter for the Whisper API.
- Whisper Language: Configures the language parameter for the Whisper API.
- Target Language: Configures the target language for translation.
This project is licensed under the MIT License. See the LICENSE file for details.