This project showcases how the Voiceflow runtime client SDK can be integrated with Discord bots powered by node.js.
- Ensure you have
nodejs
andnpm
/yarn
installed - Fork/Clone this repository
- run
yarn
ornpm install
to install the@voiceflow/runtime-client-js
anddiscord.js
dependencies
See here for instructions on how to set-up a Voiceflow project, get an API key, and locate the version ID of the project.
Open config.json
and put the API key and version ID there. This will give authorization to the Voiceflow SDK and tell it which project to make calls to.
To make a bot in discord, you will need to go to the Discord Developer Portal. Click on "New Application" in the top-right corner, give the application a name, and create the application.
Click the bot tab on the left-side, then click Add Bot
to create a bot.
Get the token for the bot and paste it into the project's config.json
.
Go to the OAuth2 tab now, select the bot
scope, and give it the permissions Send Messages
and Read Message History
. Copy the generated URL into your browser and add the bot to a server.
- Start the bot with
node index.js
. You will see the bot go online in your server. Type!start
to it to begin the conversation.