Skip to content

nicolehe/sms-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sms-bot.info

sms bot gif

🤖 sms-bot.info is a how-to guide to making an SMS bot with Google Sheets and Twilio. You write the messages your bot will send in a Google sheet, which is also where people's responses are saved.

The project is built using Google Apps Script. It creates:

  1. an SMS webhook for Twilio
  2. a Google spreadsheet sidebar add-on

It's meant to be used with this template spreadsheet.

Getting Started

The document at sms-bot.info gives detailed instructions on how to set up the project - it's written such that the user doesn't have to write code (though they do have to copy and paste some code). It's recommended that you follow the document even if you are a developer, though instead of copying and pasting the code you may want to clone this repo and use Google's clasp to develop locally.

Prerequisites

To use clasp to develop locally, first download it:

npm install -g @google/clasp

And then enable the Google Apps Script API: https://script.google.com/home/usersettings

Make a copy of this template spreadsheet.

Installing

Clone this repo and `cd into the folder:

git clone git@github.com:nicolehe/sms-bot.git
cd sms-bot

Login to clasp:

clasp login

Then create a project called "sms-bot" (or whatever you want):

clasp create sms-bot

Select "sheets" when it asks which script.

Push this code into your new Apps Script project, then open it in your browser.

clasp push
clasp open

Web app deployment

To get your web app URL, it's recommended that you deploy from the browser the first time at least. Follow (the relevant instructions in sms-bot.info)

After that you can deploy with clasp from your command line - make sure you use the deployment ID.

clasp deploy -i <id>

Testing your add-on

You do still have to manually run the add-on as a test from the project page if you change any of the sidebar code. Follow the relevant instructions in sms-bot.info.

Notes

  • Because this code was written to make it as easy as possible for people to copy and paste, Sidebar.html contains the HTML, CSS and JavaScript all in one file. You may prefer separating them and inserting them into the HTML.
  • There seems to be a bug with the V8 engine (see this note), so even though Apps Script does support ES6/TypeScript these days, the user has to deactivate V8 in order to share the add-on, which is why this code is all written in ES5.

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

  • Irene Alvarado, Kelsie Van Deman, Amit Pitaru for help and guidance
  • Hana Tanimura for design

About

an SMS bot built with Google sheets and Twilio

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published