Alexa-to-Discord
Introduction
Alexa-to-Discord is a work in progress Alexa skill which allows users to interect with their discord guild(s) using an Alexa enabled device.
Table of Contents
Features
Current Features
Currently the skill has 6 intents you can:
- Get all guilds the bot is connected to.
- Select a specific guild.
- Get the roles from the selected guild.
- Get the text channels from the selected guild.
- Get the voice channels from the selected guild.
- Get all channels in the selected guild.
Planned Features
These are features that we plan to implement when we have time or they are waiting for push notifications to be release for the echo.
- Be able to select a specific channel in the selected guild.
- Get the last x messages from the selected channel.
- Get the active users in the selected channel.
- Be able to send messages to the selected channel.
- Allow alexa to speak when a message is sent to a specific channel. (Requires push notifications)
Getting Started
Firstly, you are going to want to make sure you have a Discord account and a Amazon Developer account, although not necessary, I highly suggest getting a Heroku account as this will allow you to host your code for free without having to mess around with SSL certificated or HTTPS.
Generating your Discord token
- Go to the discord developers portal and log in with your discord account.
- Click on the "My Apps" link in the menu on the left.
- Click on "New App".
- Give it a name, adding a description and icon is optional. Once you are done, press the "Create App" button.
- After that you are going to want to click the "Create a bot user" button.
- Reveal the bot token and store this somewhere for use later on.
Deploying the Application
If you decide to not use Heroku you need to set an environment variable in the environment that the application will be running. The environment variable needs to be called "DISCORD_TOKEN" and must have a value of your discord bot token that you generated earlier.
Deploying to Heroku
- Fork this repository.
- Navigate to Heroku and login with your account.
- Create a new app and give it a name.
- Navigate to the "Settings" tab.
- Press the "Reveal config vars" button.
- Add a new var with the key "DISCORD_TOKEN" (without the "") and set the value to the token you generated earlier.
- Press the "add" button.
- Under deploy settings select the Github option.
- Login to your github account and allow Heroku access.
- Select the forked repository in the "Connect to github" section.
- Select the correct branch in the "Manual Deploy" section and press the "Deploy Branch" button.
- Press the "Open App" button and take not the url it redirects you to you will need this when configuring the Alexa skill.
Creating the Alexa Skill
- Go to the Amazon developer portal and login using your account.
- Once logged in click the "Alexa" button towards the top of the page.
- Then click the "getting started" button underneath Alexa Skills Kit.
- Then click the "Add a new skill" button towards the top right of the page.
- Leave the skill type as "Custom interaction model" then fill in the other fields too your liking. Set the invocation name to something memorable as this is what you will say to launch the skill.
- Leave audio player option to no as currently this application does not use it.
- Press the next button.
- On this page you need to place the intent schema and sample utterances in their respective boxes. You can find these in the "SpeechAssets" directory of this repository.
- Press the next button.
- On this page you need to specify how Alexa will communicate with this application. I reccomend that you fork this repository and deploy it to Heroku directly from Github.
- Leave the account linking option as no.
- Press the next button.
- Select the appropriate SSL certificate option, if you deploy to Heroku you can select "My development endpoint is a sub-domain of a domain that has a wildcard certificate from a certificate authority". Otherwise you will have to generate and provide valid signed SSL certificates for your endpoint.
- Press the save button.