Skip to content

Discord bot that uses OpenAI chatGPT under the hood. Prompts and answers using voice with(gTTS)

Notifications You must be signed in to change notification settings

antjpcdrogas/chatGPTVoiceDiscBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Your Name
Sep 27, 2024
af050eb · Sep 27, 2024
Oct 24, 2023
Feb 21, 2023
Oct 21, 2023
Oct 24, 2023
Oct 24, 2023
Mar 18, 2023
Oct 21, 2023
Sep 27, 2024
Oct 29, 2023
Oct 26, 2023
Apr 25, 2023

Repository files navigation

chatgptvoicediscbot Prettier Code Formatting

Discord bot that uses chatGPT under the hood. Written in NodeJS.Prompts and answers using voice with google text-to-speech(gTTS), OpenAI and Discord. This is my first nodeJS attempt, only possible because of GitHub co-pilot.

There is a bug in discord.js/voice, the issue is described here: discordjs/discord.js#8482

The issue happens in all OS, not only WSL2. The proposed fix is already implemented in the node_module folder located in this repo.

Installation

Features

  • Uses official Discord and OpenAI modules
  • Continuous conversation in the same session(removed due to high token usage)
  • prompts by Voice
  • Replies by Voice
  • Works with multiple languages
  • Version 2 uses stream instead of files to play audio responses. ChatGPT response is also using stream. This update increase the response time by almost 3 seconds, makins the voice response almost instant.
  • Microsoft speech recognition sdk used to transform text-to-speech
  • João and Antonio personalities added
  • (Added in v3.0.1) Continuous conversation. Uses LangChain to store the conversation. Warning: it may be expensive

Usage

var chatgptvoicediscbot = require("chatgptvoicediscbot");
chatgptvoicediscbot();
node discordChatGPTVoiceBot.js


Environment variables:
- BOT_TOKEN
- OPENAI_API_KEY
- botDiscId
- channelId
- guildId
- SpeechKey

Credits

License

ISC © Quskia