Skip to content

dabblelab/building-discord-bots-with-twilio-autopilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run on Replit.com

Cover Image

Building Discord Bots with Twilio Autopiot

This repository contains the source code for the mini-course Building Discord Bots with Twilio Autopiot. The course walks through creating a Discord bot that uses Twilio Autopilot to answer frequently asked questions.

Prerequisites

To follow along, you'll need at least a free account with the following services:

Course Outline

The course walks through building a Discord bot that lets users get answers to frequently asked questions. Twilio Autopilot provides the AI for answering the questions, and Replit.com is used for hosting a web service to proxy requests between Discord and Autopilot.

At high level, there are five topics covered.

  1. Creating a Twilio Autopilot FAQ bot
  2. Setting up a Discord server
  3. Configuring a Discord bot application and bot user
  4. Authorizing bot access to a Discord server
  5. Creating a bot handler service using replit.com

1. Creating a Twilio Autopilot FAQ bot

  • Login at twilio.com
  • Create a new bot from the FAQs pre-trained template
  • Create tasks to handel questions
  • Test the bot using the autopilot simulator
  • Note the ACCOUNT SID, AUTH TOKEN, and ASSISTANT SID

2. Setting up a Discord server

3. Configuring a Discord bot application and bot user

4. Authorizing bot access to a Discord server

  • Copy the Discord OAuth2 authorization URL
  • Authorize access to the Discord server

5. Creating a bot handler service using replit.com

  • Login to replit.com
  • Visit the GitHub repo with the handler code
  • Click the run on replit button to copy the code to replit.com
  • Setup the following secrets/environment variable in Replit
    • TWILIO_ACCOUNT_SID
    • TWILIO_AUTH_TOKEN
    • TWILIO_BOT_SID
    • DISCORD_BOT_TOKEN
  • Run the bot handler service

Testing the Discord bot

To test the Discord bot access the Discord server and ask a question in the following format.

!support {question} - for example, !support Can i move my service?

You should see a response from the bot.

Done!

About

Building Discord Bots with Twilio Autopilot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published