-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up codebase #34
base: master
Are you sure you want to change the base?
Changes from all commits
980a455
9d30bb1
5ce2ed5
ec15cb9
3882d55
48726b0
bb78a79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2019 GroupMe | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
# Sample GroupMe NodeJS Callback Bot | ||
# Sample GroupMe NodeJS Bot | ||
[**Python**](https://github.com/groupme/bot-tutorial-python) | **JavaScript** | ||
|
||
## Introduction | ||
|
||
This project shows the capability of a bot to react to messages sent within a group. | ||
A simple GroupMe bot that reacts to messages sent in a group. | ||
|
||
## Contents | ||
|
||
|
@@ -18,7 +19,7 @@ This project shows the capability of a bot to react to messages sent within a gr | |
|
||
* GroupMe account | ||
* Heroku account | ||
* [Heroku Toolbelt](https://toolbelt.heroku.com/) | ||
* [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli) | ||
|
||
# Get your bot up and running<a name="deploy"></a> | ||
|
||
|
@@ -55,10 +56,10 @@ Fill out the form to create your new bot: | |
|
||
* Select the group where you want the bot to live | ||
* Give your bot a name | ||
* Paste in the url to your newly deply heroku app | ||
* Paste in the URL of your newly deployed Heroku app | ||
* `http://your-app-name-here.herokuapp.com/` | ||
* (Optional) Give your bot an avatar by providing a url to an image | ||
* Click submit | ||
* (Optional) Give your bot an avatar by providing the URL of an image | ||
* Click submit! | ||
|
||
## Find your Bot ID:<a name="get-bot-id"></a> | ||
|
||
|
@@ -113,37 +114,51 @@ Go to GroupMe and type "/cool guy" in the group where your bot lives to see it i | |
|
||
Within terminal, change directory to the location where you would like the files to live, then run this command: | ||
|
||
$ heroku git:clone -a YOUR_APP_NAME_HERE | ||
```sh | ||
heroku git:clone -a YOUR_APP_NAME_HERE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Syntax highlighting! |
||
``` | ||
|
||
And then change directory into the new folder | ||
|
||
$ cd YOUR_APP_NAME_HERE | ||
```sh | ||
cd YOUR_APP_NAME_HERE | ||
``` | ||
|
||
## Configure your local BOT_ID environment variable | ||
|
||
Open the file `.env` from your local files in your text editor of choice. | ||
Find where it says "YOUR_BOT_ID_HERE" and replace it with the ID of your new bot. | ||
|
||
If you don't know what your Bot ID is, please refer back to [this](#get-bot-id) section, | ||
where it is explained how to retrieve it. | ||
If you don't know what your Bot ID is, please refer back to [this](#get-bot-id) section, where it is explained how to retrieve it. | ||
|
||
If your Bot ID is 12345678910, then: | ||
|
||
BOT_ID="YOUR_BOT_ID_HERE" | ||
```sh | ||
BOT_ID="YOUR_BOT_ID_HERE" | ||
``` | ||
|
||
becomes: | ||
|
||
BOT_ID="12345678910" | ||
```sh | ||
BOT_ID="12345678910" | ||
``` | ||
|
||
## Start the server | ||
|
||
To test your bot locally, open terminal and run the following command to start a local server. | ||
|
||
$ foreman start | ||
```sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Foreman seems nonstandard |
||
npm start | ||
``` | ||
|
||
or | ||
|
||
```sh | ||
node index.js | ||
``` | ||
|
||
Then navigate to `http://127.0.0.1:5000/` in a browser. | ||
|
||
![Local bot](http://i.groupme.com/502x133.png.f06c630467954f5dab4c742dc67b71bf) | ||
|
||
## All done! Go play around and make the bot your own. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "Cool guy bot", | ||
"description": "Basic Groupme Bot written in Node", | ||
"repository": "https://github.com/petemcgrath/cool-guy-bot", | ||
"description": "Basic GroupMe Bot written in Node.js", | ||
"repository": "https://github.com/groupme/bot-tutorial-nodejs", | ||
"logo": "http://www.tailgate365.com/wp-content/uploads/2011/06/tom-hanks-906.jpg", | ||
"keywords": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ server.listen(port); | |
function ping() { | ||
this.res.writeHead(200); | ||
this.res.end("Hey, I'm Cool Guy."); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "node-js-getting-started", | ||
"name": "bot-tutorial", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was never changed from wherever it was copied from. |
||
"version": "0.1.2", | ||
"description": "A sample Node.js app using Express 4", | ||
"description": "A simple GroupMe bot written in Node.js", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js" | ||
|
@@ -15,12 +15,14 @@ | |
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/heroku/node-js-getting-started" | ||
"url": "https://github.com/groupme/bot-tutorial-nodejs" | ||
}, | ||
"keywords": [ | ||
"node", | ||
"heroku", | ||
"express" | ||
"express", | ||
"groupme", | ||
"bot" | ||
], | ||
"license": "MIT" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heroku Toolbelt is now called Heroku CLI.