Skip to content

Commit f2ef04d

Browse files
committed
cleanup some leftover stuff from botkit generator
1 parent b48c4c8 commit f2ef04d

File tree

5 files changed

+29
-233
lines changed

5 files changed

+29
-233
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
# Instructions for Contributing Code
1+
We welcome any and all improvements to `@RSS` to help ensure
2+
that it adds value to your Slack channels.
23

3-
This project welcomes contributions and suggestions. Most contributions require you to agree to a
4-
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5-
the rights to use your contribution. For details, visit https://cla.microsoft.com.
6-
7-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
8-
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
9-
provided by the bot. You will only need to do this once across all repos using our CLA.
10-
11-
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
12-
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
13-
provided by the bot. You will only need to do this once across all repos using our CLA.
14-
15-
## Code of Conduct
16-
17-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
4+
More concrete developer guidelines will be posted in the near
5+
future.

bot.js

Lines changed: 16 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ var bot_options = {
6161
clientSecret: process.env.clientSecret,
6262
clientSigningSecret: process.env.clientSigningSecret,
6363
scopes: ['bot'],
64-
studio_token: process.env.studio_token,
65-
studio_command_uri: process.env.studio_command_uri,
6664
// debug: true,
6765
};
6866

@@ -84,88 +82,24 @@ controller.startTicking();
8482
// Set up an Express-powered webserver to expose oauth and webhook endpoints
8583
var webserver = require(__dirname + '/components/express_webserver.js')(controller);
8684

87-
if (!process.env.clientId || !process.env.clientSecret) {
88-
89-
// Load in some helpers that make running Botkit on Glitch.com better
90-
require(__dirname + '/components/plugin_glitch.js')(controller);
91-
92-
webserver.get('/', function(req, res){
93-
res.render('installation', {
94-
domain: req.get('host'),
95-
protocol: req.protocol,
96-
glitch_domain: process.env.PROJECT_DOMAIN,
97-
layout: 'layouts/default'
98-
});
99-
})
100-
101-
var where_its_at = 'http://' + (process.env.PROJECT_DOMAIN ? process.env.PROJECT_DOMAIN+ '.glitch.me/' : 'localhost:' + process.env.PORT || 3000);
102-
console.log('WARNING: This application is not fully configured to work with Slack. Please see instructions at ' + where_its_at);
103-
}else {
104-
105-
webserver.get('/', function(req, res){
106-
res.render('index', {
107-
domain: req.get('host'),
108-
protocol: req.protocol,
109-
glitch_domain: process.env.PROJECT_DOMAIN,
110-
layout: 'layouts/default'
111-
});
112-
})
113-
// Set up a simple storage backend for keeping a record of customers
114-
// who sign up for the app via the oauth
115-
require(__dirname + '/components/user_registration.js')(controller);
116-
117-
// Send an onboarding message when a new team joins
118-
require(__dirname + '/components/onboarding.js')(controller);
119-
120-
// Load in some helpers that make running Botkit on Glitch.com better
121-
require(__dirname + '/components/plugin_glitch.js')(controller);
122-
123-
var normalizedPath = require("path").join(__dirname, "skills");
124-
require("fs").readdirSync(normalizedPath).forEach(function(file) {
125-
require("./skills/" + file)(controller);
85+
webserver.get('/', function(req, res){
86+
res.render('index', {
87+
domain: req.get('host'),
88+
protocol: req.protocol,
89+
glitch_domain: process.env.PROJECT_DOMAIN,
90+
layout: 'layouts/default'
12691
});
92+
});
12793

128-
// This captures and evaluates any message sent to the bot as a DM
129-
// or sent to the bot in the form "@bot message" and passes it to
130-
// Botkit CMS to evaluate for trigger words and patterns.
131-
// If a trigger is matched, the conversation will automatically fire!
132-
// You can tie into the execution of the script using the functions
133-
// controller.studio.before, controller.studio.after and controller.studio.validate
134-
if (process.env.studio_token) {
135-
controller.on('direct_message,direct_mention,mention', function(bot, message) {
136-
controller.studio.runTrigger(bot, message.text, message.user, message.channel, message).then(function(convo) {
137-
if (!convo) {
138-
// no trigger was matched
139-
// If you want your bot to respond to every message,
140-
// define a 'fallback' script in Botkit CMS
141-
// and uncomment the line below.
142-
// controller.studio.run(bot, 'fallback', message.user, message.channel);
143-
} else {
144-
// set variables here that are needed for EVERY script
145-
// use controller.studio.before('script') to set variables specific to a script
146-
convo.setVar('current_time', new Date());
147-
}
148-
}).catch(function(err) {
149-
bot.reply(message, 'I experienced an error with a request to Botkit CMS: ' + err);
150-
debug('Botkit CMS: ', err);
151-
});
152-
});
153-
} else {
154-
console.log('~~~~~~~~~~');
155-
console.log('NOTE: Botkit CMS functionality has not been enabled');
156-
console.log('Learn mode https://github.com/howdyai/botkit-cms');
157-
}
158-
}
159-
94+
// Set up a simple storage backend for keeping a record of customers
95+
// who sign up for the app via the oauth
96+
require(__dirname + '/components/user_registration.js')(controller);
16097

98+
// Send an onboarding message when a new team joins
99+
require(__dirname + '/components/onboarding.js')(controller);
161100

101+
var normalizedPath = require("path").join(__dirname, "skills");
162102

163-
164-
function usage_tip() {
165-
console.log('~~~~~~~~~~');
166-
console.log('Botkit Starter Kit');
167-
console.log('Execute your bot application like this:');
168-
console.log('clientId=<MY SLACK CLIENT ID> clientSecret=<MY CLIENT SECRET> PORT=3000 node bot.js');
169-
console.log('Get Slack app credentials here: https://api.slack.com/apps')
170-
console.log('~~~~~~~~~~');
171-
}
103+
require("fs").readdirSync(normalizedPath).forEach(function(file) {
104+
require("./skills/" + file)(controller);
105+
});

components/plugin_glitch.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

glitch_readme.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

readme.md

Lines changed: 9 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,14 @@
1-
# Botkit Starter Kit for Slack Bots
1+
# RSS Bot for Slack
22

3-
This repo contains everything you need to get started building a Slack bot with [Botkit](https://botkit.ai).
3+
`@RSS` was built using [Botkit](https://botkit.ai).
44

5-
Botkit is designed to ease the process of designing and running useful, creative bots that live inside messaging platforms. Bots are applications that can send and receive messages, and in many cases, appear alongside their human counterparts as users.
5+
Once you add `@RSS` to a channel in your Slack Workspace, it
6+
will listen for any links that are posted.
67

7-
Some bots talk like people, others silently work in the background, while others present interfaces much like modern mobile applications. Botkit gives developers the necessary tools for building bots of any kind! It provides an easy-to-understand interface for sending and receiving messages so that developers can focus on creating novel applications and experiences instead of dealing with API endpoints.
8+
When a user posts a link, they will be asked if they want to
9+
add that link to the RSS Feed for that channel.
810

9-
Our goal with Botkit is to make bot building easy, fun, and accessible to anyone with the desire to create a future filled with talking machines!
11+
Each channel that `@RSS` is in will get it's own RSS Feed.
1012

11-
If you are looking to create a bot on other platforms using Glitch, check out the [Botkit project page](https://glitch.com/botkit).
12-
13-
### What's Included
14-
* [Botkit core](https://botkit.ai/docs/core.html) - a complete programming system for building conversational software
15-
* [Pre-configured Express.js webserver](https://expressjs.com/) including:
16-
* A customizable "Install my Bot" homepage
17-
* Login and oauth endpoints that allow teams to install your bot
18-
* Webhook endpoints for communicating with platforms
19-
* Sample skill modules that demonstrate various features of Botkit
20-
21-
### Getting Started
22-
23-
There are a myriad of methods you can use to set up an application on Slack, here are some of your options:
24-
25-
#### Install Botkit
26-
27-
[Remix this project on Glitch](https://glitch.com/~botkit-slack)
28-
29-
[Deploy to Heroku](https://heroku.com/deploy?template=https://github.com/howdyai/botkit-starter-slack/master)
30-
31-
Clone this repository using Git:
32-
33-
`git clone https://github.com/howdyai/botkit-starter-slack.git`
34-
35-
Install dependencies, including [Botkit](https://github.com/howdyai/botkit):
36-
37-
```
38-
cd botkit-starter-slack
39-
npm install
40-
```
41-
42-
#### Set up your Slack Application
43-
Once you have setup your Botkit development enviroment, the next thing you will want to do is set up a new Slack application via the [Slack developer portal](https://api.slack.com/). This is a multi-step process, but only takes a few minutes.
44-
45-
* [Read this step-by-step guide](https://botkit.ai/docs/provisioning/slack-events-api.html) to make sure everything is set up.
46-
47-
* We also have this [handy video walkthrough](https://youtu.be/us2zdf0vRz0) for setting up this project with Glitch.
48-
49-
Update the `.env` file with your newly acquired tokens.
50-
51-
Launch your bot application by typing:
52-
53-
`node .`
54-
55-
Now, visit your new bot's login page: http://localhost:3000/login
56-
57-
Now comes the fun part of [making your bot!](https://botkit.ai/docs/#build-your-bot)
58-
59-
60-
### Extend This Starter kit
61-
62-
This starter kit is designed to provide developers a robust starting point for building a custom bot. Included in the code are a set of sample bot "skills" that illustrate various aspects of the Botkit SDK features. Once you are familiar with how Botkit works, you may safely delete all of the files in the `skills/` subfolder.
63-
64-
Developers will build custom features as modules that live in the `skills/` folder. The main bot application will automatically include any files placed there.
65-
66-
A skill module should be in the format:
67-
68-
```
69-
module.exports = function(controller) {
70-
71-
// add event handlers to controller
72-
// such as hears handlers that match triggers defined in code
73-
// or controller.studio.before, validate, and after which tie into triggers
74-
// defined in the Botkit CMS UI.
75-
76-
}
77-
```
78-
79-
### Customize Storage
80-
81-
By default, the starter kit uses a simple file-system based storage mechanism to record information about the teams and users that interact with the bot. While this is fine for development, or use by a single team, most developers will want to customize the code to use a real database system.
82-
83-
There are [Botkit plugins for all the major database systems](https://botkit.ai/readme-middlewares.html#storage-modules) which can be enabled with just a few lines of code.
84-
85-
We have enabled our [Mongo middleware]() for starters in this project. To use your own Mongo database, just fill out `MONGO_URI` in your `.env` file with the appropriate information. For tips on reading and writing to storage, [check out these medium posts](https://botkit.groovehq.com/knowledge_base/categories/build-a-bot)
86-
87-
# Developer & Support Community
88-
89-
You can find full documentation for Botkit on [our website](https://botkit.ai/docs).
90-
91-
### Need more help?
92-
* Glitch allows users to ask the community for help directly from the editor! For more information on raising your hand, [read this blog post.](https://medium.com/glitch/just-raise-your-hand-how-glitch-helps-aa6564cb1685)
93-
94-
* Join our thriving community of Botkit developers and bot enthusiasts at large. Over 4500 members strong, [our open Slack group](http://community.botkit.ai) is _the place_ for people interested in the art and science of making bots.
95-
96-
Come to ask questions, share your progress, and commune with your peers!
97-
98-
* We also host a [regular meetup and annual conference called TALKABOT.](http://talkabot.ai) Come meet and learn from other bot developers!
99-
100-
[Full video of our 2016 event is available on Youtube.](https://www.youtube.com/playlist?list=PLD3JNfKLDs7WsEHSal2cfwG0Fex7A6aok)
101-
102-
103-
104-
# About Botkit
105-
106-
Botkit is a product of [Howdy](https://howdy.ai) and made in Austin, TX with the help of a worldwide community of botheads.
13+
Any user can get the RSS Feed URL for the current channel by
14+
using the `/rssfeed` slash command.

0 commit comments

Comments
 (0)