Skip to content

Instantly share code, notes, and snippets.

View sweetyclem's full-sized avatar

Clementine sweetyclem

  • Kelowna
View GitHub Profile
# Create an image based on this existing ruby image
FROM ruby:2.4.1
# Install the software you need
RUN apt-get update \
&& apt-get install -y \
apt-utils \
build-essential \
libpq-dev \
libjpeg-dev \
# Set docker-compose version
version: '3'
services:
postgres:
container_name: postgres
ports:
- "5432:5432"
volumes:
- $HOME/postgres-data:/var/lib/postgresql
{
"text": "Hello! What subject would you like to learn more about?",
"fallback": "Upgrade your Slack client to use messages like these.",
"color": "#3AA3E3",
"attachment_type": "default",
"callback_id": "subjects",
"actions": [
{
"name": "subject_list",
"text": "Select one",
const { createEventAdapter } = require('@slack/events-api')
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET
const slackEvents = createEventAdapter(slackSigningSecret)
const { WebClient } = require('@slack/web-api')
const token = process.env.SLACK_BOT_TOKEN
const web = new WebClient(token)
const subjects = require('./elements/subjects.json')
function listenForEvents(app) {
app.use('/events', slackEvents.requestListener())
const { createEventAdapter } = require('@slack/events-api')
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET
const slackEvents = createEventAdapter(slackSigningSecret)
function listenForEvents(app) {
app.use('/events', slackEvents.requestListener())
}
slackEvents.on('app_mention', (event) => {
console.log(`Received an app_mention event from user ${event.user} in channel ${event.channel}`)
if (process.env.NODE_ENV !== "production")
{
require("dotenv").config()
}
const express = require('express')
const port = process.env.PORT
const app = express()
app.listen(port, function () {
/node_modules
npm-debug.log
.DS_Store
/*.env
{
"fallback": "Upgrade your Slack client to use messages like these.",
"color": "#3AA3E3",
"attachment_type": "default",
"actions": [
{
"name": "article",
"text": "Article",
"type": "button",
"value": "article"
const { createMessageAdapter } = require('@slack/interactive-messages')
const slackSigningSecret = process.env.SLACK_SIGNING_SECRET
const slackInteractions = createMessageAdapter(slackSigningSecret)
const articleOrBookButton = require('./elements/articleOrBookButton.json')
module.exports.listenForInteractions = function (app) {
app.use('/interactions', slackInteractions.requestListener())
}
slackInteractions.action({ type: 'select' }, (payload, respond) => {
[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Here is an <https://witanddelight.com/2020/05/how-white-people-can-be-better-allies-to-the-black-community/|article>: ow how white people can be better allies to the black community :rolled_up_newspaper: :fist:"
}
}
]