I hereby claim:
- I am selfcontained on github.
- I am selfcontained (https://keybase.io/selfcontained) on keybase.
- I have a public key whose fingerprint is 9F85 586A BB68 A98F 5DA3 6155 6EEE 9E14 4105 3575
To claim this, I am signing this object:
// Example refreshAuth fn that might call Google | |
function refreshAuth (oldToken, done) { | |
console.log('actually refreshing the old token', oldToken) | |
setTimeout(() => { | |
done(null, getNewToken()) | |
}, 2000) | |
} | |
// Pretend we're issuing new tokens | |
let token = 1 |
const slapp = require('slapp') | |
slapp.message('^(hi|hello|hey).*', ['direct_mention', 'direct_message'], helloHandler) | |
// Pull slapp message handler into a function you can export and test | |
function helloHandler (msg, text, greeting) { | |
msg.say(`${greeting}, how are you?`) | |
} | |
// write a test for just the handler |
import React from 'react' | |
class LazyLoad extends React.Component { | |
constructor () { | |
super(...arguments) | |
this.state = { | |
isLoaded: false | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
const Slapp = require('slapp') | |
const BeepBoopContext = require('slapp-context-beepboop') | |
const BeepBoopConvo = require('slapp-convo-beepboop') | |
const smb = require('slack-message-builder') | |
let slapp = Slapp({ | |
verify_token: process.env.SLACK_VERIFY_TOKEN, | |
context: BeepBoopContext(), | |
convo_store: BeepBoopConvo() | |
}) |
var Slapp = require('slapp') | |
var slapp = Slapp( | |
// ..slapp options | |
) | |
// Add this line ⤵️ | |
require('beepboop-slapp-presence-polyfill')(slapp) |
'use strict' | |
const Slapp = require('slapp') | |
const Context = require('./context') | |
const ConvoStore = require('./convo-store') | |
module.exports = (server, db) => { | |
let app = Slapp({ | |
verify_token: process.env.SLACK_VERIFY_TOKEN, | |
context: Context(db), |
'use strict' | |
// Slim wrapper around data module for Slapp ConvoStore | |
module.exports = (db) => { | |
return { | |
set (id, params, done) { | |
db.saveConvo(id, params, done) | |
}, | |
get (id, done) { | |
db.getConvo(id, done) |
'use strict' | |
// Slapp context middleware function | |
// Looks up team info from db and enriches request | |
module.exports = (db) => { | |
return (req, res, next) => { | |
let teamId = req.slapp.meta.team_id | |
db.getTeam(teamId, (err, team) => { | |
if (err) { |
'use strict' | |
const path = require('path') | |
const firebase = require('firebase-admin') | |
module.exports = () => { | |
const firebaseDBUrl = process.env.FIREBASE_DB_URL | |
const serviceAccountBase64 = process.env.FIREBASE_SERVICE_ACCOUNT_BASE64 | |
firebase.initializeApp({ |