Skip to content
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

Improvements, adding RTM option in bot options #3

Merged
merged 3 commits into from Dec 5, 2018

Conversation

seriouslysean
Copy link
Contributor

@seriouslysean seriouslysean commented Dec 5, 2018

Various cleanup and some RTM (Real Time Messaging) requirements. Comments inline!

@seriouslysean seriouslysean added the enhancement New feature or request label Dec 5, 2018
var env_file = __dirname + '/.env';
const fs = require('fs');
const env = require('node-env-file');
const env_file = __dirname + '/.env';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted a lot of the vars to consts for security.

bot.js Outdated
clientId: process.env.clientId,
clientSecret: process.env.clientSecret,
clientSigningSecret: process.env.clientSigningSecret,
// debug: true,
scopes: ['bot'],
studio_token: process.env.studio_token,
studio_command_uri: process.env.studio_command_uri
studio_command_uri: process.env.studio_command_uri,
require_delivery: true, // required for RTM (Real Time Messaging) support
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required if we ever use RTM, it makes sure a message is delivered before the bot actions on it and ensures things happen in order.


// Load in some helpers that make running Botkit on Glitch.com better
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all the Glitch.com stuff we'll never use.

protocol: req.protocol,
glitch_domain: process.env.PROJECT_DOMAIN,
layout: 'layouts/default'
webserver.get('/', (req, res) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have a clientId and clientSecret, just show the install page.


webserver.get('/', (req, res) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't have a clientId or clientSecret, just show a very basic message.

bot.js Outdated

var bot_options = {
const bot_options = {
clientId: process.env.clientId,
clientSecret: process.env.clientSecret,
clientSigningSecret: process.env.clientSigningSecret,
// debug: true,
scopes: ['bot'],
studio_token: process.env.studio_token,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove studio tokens since we aren't going to use that

@dgautsch dgautsch added this to the v1.0 milestone Dec 5, 2018
@seriouslysean seriouslysean merged commit 389b82e into master Dec 5, 2018
@seriouslysean seriouslysean deleted the seriouslysean/seanbot branch December 5, 2018 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants