Giter VIP home page Giter VIP logo

harold's Introduction

Project Board

https://trello.com/b/iAvdXVNU/harold-bot

harold-question-bot

A simple slack bot which will ask a random member of the #under30s channel a random question

Cron Schedule

Runs Monday to Friday at 10.15am AEDT

About

Project is deployed using the serverless framework.

Harold runs as a nodeJS Lambda which is triggered on a Cron Schedule. He uses the groups.info Slack API to retrieve a list of user's for a channel and then sends a question to the channel via a webhook. You can access Harold's slack integration options from here: https://api.slack.com/apps/A81E1D9U1 If you do not have access PM @sean on Slack to be added as a contributor.

The list of questions is provided as a separate text file resource to the main application logic.

Blacklisting Users

Since the groups.info returns all members of a group, it will also return inactive users and bots. Harold has a simple blacklist mechanism which takes an array of userID's and reselects a user if a blacklisted user is chosen. To blacklist a user, simply add their userID to the memberBlacklist array in handler.js.

An additional script is supplied called ID_checker.js which retrieves the name and userID of all members in a channel to aid with determining members' userIDs.

The ID checker app can be run locally with:

node ID_checker.js

Deploy

To deploy harold, configure serverless credentials locally and then run:

sls deploy --aws-profile default --verbose

Secrets

This is a quick and dirty script, there is no secrets management here. As such, secrets are removed during git commits and will need to be manually updated when doing a serverless deploy. Before performing a sls deploy please ensure you have updated the TOKEN and WEBHOOK_URL variables in the top of handler.js (and ID_checker.js)

Notes

TOKEN constant is the Oauth token

harold's People

Contributors

rldiao avatar

Watchers

 avatar

harold's Issues

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.