gtracy / slack-stuart Goto Github PK
View Code? Open in Web Editor NEWAn extendable bot server for Slack
License: MIT License
An extendable bot server for Slack
License: MIT License
There are some host details in Stuart's config file but their only used for the Twilio integration.
Move them out of the config file and into the twilio plugin config property.
The config parameters have changed since the original implementation. Stuart should not be tacking on the token value on the endpoint for POST calls to the incoming webhook.
lib/bot.js:13
this.endpoint = host;// + "?token=" + token;
When using the SMS routing (twilio.js:/sms/receive), the server will hang when running with node 0.10.22. The root cause appears to be in the twilio-node package. A bug has been filed here:
Stuart could do a better job of logging inbound requests on the express interface. Right now it's quiet which makes it harder to figure out if your server ever sees a request.
Add the following to app.js
// simple logger
app.use(function(req, res, next){
logme.info(req.method + ' ' + req.url);
next();
});
When sending messages via SMS, the caller should be able to specify the channel they'd like the message to be posted to.
The instructions for configuration could be made much more clear. Including screenshots and specific Slack integration references.
It would be nice if Stuart was fully npmified.
Please review the package.json definition and incorporate script definitions to start the service.
The default channel for a plugin is hard-coded inside the plugin. It would be nice to just add it to the plugin configuration to consolidate configuration.
The current implementation isn't validating the input parameters to verify that the request is coming from Slack.
I tried following the instructions and it seems to be on the verge of working, but why does the output not come back to Slack? I can see the DEBUG messages in node of what it would be saying.
I'm sure I did something wrong following the instructions, but I checked a few times. If you have any tips please let me know.
When Stuart starts, make an attempt to validate the config.js file to give the dev a heads up when things don't look right.
Not sure what the impact is on npm packages, but presumably there is work to do here.
For example, /stuart AMA will fail.
The slash_command() function on the _Stuart prototype should explicitly convert the user command to lowercase for cleaner processing.
Small cosmetic item... Would be nice to have a configuration option to override the /stuart
shown in the help text. For example, I could setup my Slack slash command to be /chucknorris
, but the help text would still show The format is always '/stuart
.
The Inbound Webhook has a nice attachments feature that allows you to post images and other rich copy. The bot should support that in its post call.
There is some nice code that attempts to periodically delete old conference lines created using the "conference" plugin. Trouble is, the task never runs.
The conference plugin has a smidge of cron job code at the bottom of the hook file. Need to wire that up so the schedule actually gets set.
Right now, the run method signature takes the raw request string directly from the bot integration. This includes the command itself and it requires every single plugin to parse the string themselves.
Integration would be easier if the run methods simply received a list of command arguments.
module.exports.run = function(request_args, stuart, plugin)
request_args should be a list of strings.
For example, the food command would take ["sushi"] as the first parameter rather than "food sushi"
The return status on bogus channels has changed. So the test Stuart uses to validate the configuration no longer works during startup.
Without that, none of the slash or cron plugins will initialize.
The return body is now "channel_not_found" rather than "Invalid channel specified"
Line 23 of stuart.js
Hi, thanks for the fix. I now see this:
Success! Stuart is running.
When I go to slack and type /stuart, I see this in my console:
ERROR - Illegal command :
DEBUG - New SlackBot request being posted-- That command does not compute. Try asking me for help. (to @xxxxxx)
{ text: 'That command does not compute. Try asking me for help.',
channel: '@xxxxx',
username: 'Stuart',
icon_emoji: ':construction_worker:',
link_names: 1 }
On Slack, I get nothing back.
If I try /stuart help, I see the intended output in my console but nothing geta sent back to slack.
Do you know where I went wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.