Giter VIP home page Giter VIP logo

project_greeter_bot's Introduction

Project Greeter Bot

The idea behind the project greeter bot is to be able to help new people orient when joining project Slack channels.

Ideally human project maintainers would do this, but we have the problem that Slack doesn't actively notify channel members when someone joins a channel - and sometimes project maintainers are not around so the idea is that a bot with a canned message might be able to help.

The member joining can be seen if you are in the channel like so:

but unlike new messages, or @name, @here, @channel the join neither highlights the channel, nor adds a number in a circle.

This project is all about onboarding people and making them feel welcome, comfortable and giving them the info they need. Are bots unfriendly? Should we be notifying real humans to come and welcome folk in?

Installation

(Fork and) Clone the project to your local machine:

$ git clone https://github.com/AgileVentures/project_greeter_bot

and then install the dependencies

$ npm install

This project requires a Slack API key set as an env variable to TOKEN.

Manual Testing

You can get your own test token at #get tokens , or come to the #bots channel on the AV slack to ask @tansaku for a token for the agileventuresbottest slack.

To work with the bottest slack you'll need to configure your environment variables:

Create a .env file at the root directory and set the following variables. (See the .env.sample file as an example.)

TOKEN=YOUR_OWN_TEST_TOKEN or THE_TOKEN_FOR_BOTTEST_SLACK
NODE_ENV=development

Run and passed the test

$ npm test

Then you can start the bot like so:

$ npm start

and if you join one the channels at the bottest slack you should be able to see something like the following from your bot

Dokku deploy to production

This will only work if you have been given access to our dokku system - this is for advanced users who have demonstrated ongoing committment to the project.

To make the commands simple, add the following to your ~/.ssh/config

Host avp-dokku
HostName agileventures-playground.westeurope.cloudapp.azure.com
User dokku

Then the following commands (assuming you have the correct ssh key set up) will create an app and allow pushing to the production server via git

$ ssh avp-dokku apps:create projectgreeterbot-production # if app not yet created
$ git remote add projectgreeterbot-production [email protected]:projectgreeterbot-production    # assuming you are in local directory for this project -- only needed first time
$ git push projectgreeterbot-production master

old notes

ssh [email protected] apps:create projectgreeterbot-production
ssh [email protected] config:set projectgreeterbot-production PROJECT_GREETER_SLACK_BOT_TOKEN=XXXXX
ssh [email protected] config projectgreeterbot-production set PROJECT_SLACK_CHANNEL_ID=C0KK907B5
git push azure-production master

project_greeter_bot's People

Contributors

joaopapereira avatar tansaku avatar

Stargazers

 avatar

Watchers

 avatar

project_greeter_bot's Issues

some mechanism to actually let maintainer know that a new user has joined

I was hoping that simply mentioning the maintainer in the bot message might have this effect, but not so.

If the user follows the instruction to flag the maintainer in any question it should be fine, but some people don't understand that part of flag - I'm looking to ensure that any question from a new person joining the channel gets noticed, but I get I'm pushing too hard on a corner case ...

bot going offline after some period?

that didn't happen on EC2 hosting ... ah, logs show:

]: notice: RTM websocket opened
2017-07-20T20:50:00.626753358Z app[web.1]: /app/server.js:55
2017-07-20T20:50:00.626791424Z app[web.1]:   greet = greet.replace('USER_NAME', message.user);
2017-07-20T20:50:00.626818040Z app[web.1]:                ^
2017-07-20T20:50:00.626822460Z app[web.1]: 
2017-07-20T20:50:00.626824971Z app[web.1]: TypeError: Cannot read property 'replace' of undefined
2017-07-20T20:50:00.626858617Z app[web.1]:     at Object.<anonymous> (/app/server.js:55:16)
2017-07-20T20:50:00.626862534Z app[web.1]:     at Object.Botkit.botkit.trigger (/app/node_modules/botkit/lib/CoreBot.js:986:49)
2017-07-20T20:50:00.626865447Z app[web.1]:     at Object.<anonymous> (/app/node_modules/botkit/lib/SlackBot.js:752:30)
2017-07-20T20:50:00.626868460Z app[web.1]:     at Object.Botkit.botkit.trigger (/app/node_modules/botkit/lib/CoreBot.js:986:49)
2017-07-20T20:50:00.626871272Z app[web.1]:     at /app/node_modules/botkit/lib/CoreBot.js:1090:32
2017-07-20T20:50:00.626873683Z app[web.1]:     at Object.bot.findConversation (/app/node_modules/botkit/lib/Slackbot_worker.js:751:9)
2017-07-20T20:50:00.626893871Z app[web.1]:     at /app/node_modules/botkit/lib/CoreBot.js:1086:21
2017-07-20T20:50:00.626897487Z app[web.1]:     at next (/app/node_modules/ware/lib/index.js:82:27)
2017-07-20T20:50:00.626900098Z app[web.1]:     at Ware.run (/app/node_modules/ware/lib/index.js:88:3)
2017-07-20T20:50:00.626902810Z app[web.1]:     at Object.Botkit.botkit.receiveMessage (/app/node_modules/botkit/lib/CoreBot.js:1081:35)

easier in ruby?

would all this be easier in ruby (the testing part?) less asynchronous stuff to worry about, but then again, is node much lighter weight and will cost less to run on the server?

avoid posting if we've recently done so

if the intro post is still visible (e.g. not more than two big chunks of new text) we could avoid posting it and say something shorter, referring the new person to the previous post

support different environments

would like to be able to run in test and production modes - something like this:

if process.env.ENV == 'production'
  const greetings = { 
                    'C0KK907B5': ls_greet, 
                    'C029E8G80': wso_greet, 
                    'C5LCQSJMA': rfm_greet, 
                    'C724RCXT7': wed_greet,
                    'C0VEPAPJP': metplus_greet,
                    'C3ETFTYHK': bot_greet, 
                    'C2HGJF54G': async_greet
                  };
else
  const greetings = { 
    'CDLLCBT4Z': ls_greet, 
    'CDM8RJUBU': wso_greet, 
    'CDLLCJJGH': rfm_greet, 
    'CDM5X3TFV': wed_greet,
    'CDNAU3CCB': metplus_greet,
    'CDNDNJPHQ': bot_greet,
    'CDMRA0DS5': async_greet
  };

then run via: ENV=PRODUCTION npm start

update outdated dependencies

as part of the deploy to Google Clout Platform, there was an error in the logs suggesting to update botkit
there are also two other dependencies which are outdated chai and mocha

run npm outdated to see the results

grab channel ids from slack api

rather than having them hard coded? but then channel names might change .... make them configurable through bot interface?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.