Slack Bot for Dorm Room Fund
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
words
.babelrc
.env.example
.eslintrc.js
.flowconfig
.gitignore
Procfile
README.md
package-lock.json
package.json

README.md

DRFBot

A Slack bot for DRF! Check out the readme here for an overview.

Interactions

The entire bot is based around the notion of Interactions. Define new ones in src/interactions/ and extend BaseInteraction. Each interaction must define a array of patterns to listen for, an array of message types to act on, and a hook for responding. Types are below for reference.

type MessageType = 'direct_message' | 'ambient' | 'direct_mention' | 'mention';
type MessageTypes = 'message_received' | Array<MessageType>;
type Pattern = string | RegExp;
type Patterns = Array<Pattern> | Immutable.List<Pattern>;
type AsyncPatterns = Patterns | Promise<Patterns>;
type Hook = (bot: SlackBot, message: Message) => void;

interface Interaction {
  patterns: AsyncPatterns;
  messageTypes: MessageTypes;
  hook: Hook;
}

Current interactions

LadiesAndGentsInteraction

@channel's everyone echoing whatever was said that contains the phrase "ladies and gentlemen".

Example: Ladies and gents, I have an announcement!

ClaimInteraction

Allows a partner to claim a currently-unassigned company which has applied on the site and is waiting in Trello.

Example: @drfbot claim TheNextGoogle

CompanyMentionInteraction

Broadcasts with a custom overview for any company that's mentioned.

Example: I'm super excited about Xperii!

PointPartnerQuestionInteraction

Responds with an answer for any company whose point partners someone asks a question about.

Example: Who is the point partner for BrainSpec?

SnapshotQuestionInteraction

Responds with an answer for any company whose snapshot someone asks a question about.

Example: Where's the snapshot for BrainSpec?

CompanyInteraction

Responds with a custom overview and Trello bot prompt for any company that is included in the query.

Example: @drfbot company Spyce

SendLoveInteraction

Send some love to another partner!

Example: Send some love to @yasyf!