This bot listens to utterances in a specified voice channel, sends them to Google Cloud Speech-To-Text API (which supports more than 100 languages and dialects), and posts the transcription into a text channel.
Thanks to Discord, each user gets their own voice stream, which means this bot can figure out who said what.
Transcription costs $0.006 for each message shorter than 15 seconds.
Known issue: This bot somehow stops working after a while. I haven’t figured out how to fix it yet. If you’ve figured it out, please send a PR. Thanks!!
Create these files:
{
"token": "________________________.______.___________________________",
"guildId": "__________________",
"voiceChannelName": "voice",
"textChannelName": "voice-transcript",
"languageCode": "en_US"
}
Put your service account’s JSON credentials here.
Node.js required.
# Install dependencies
yarn
# Run the bot
yarn start
# Build a Docker image
docker build -t discord-transcriber .
# Create a folder to hold config
mkdir -p /etc/discord-transcriber
# Put configuration files there
cat > /etc/discord-transcriber/discord.config.json # Paste
cat > /etc/discord-transcriber/google-cloud.credentials.json # Paste
# Run the container
docker run -d \
-v /etc/discord-transcriber/discord.config.json:/usr/src/app/discord.config.json \
-v /etc/discord-transcriber/google-cloud.credentials.json:/usr/src/app/google-cloud.credentials.json \
--restart=always \
--name=discord-transcriber \
discord-transcriber
# View logs
docker logs discord-transcriber