Skip to content

Instantly share code, notes, and snippets.

Making Slack tools in Japan

Kazuhiro Sera seratch

Making Slack tools in Japan
View GitHub Profile
seratch / MyApp.kt
Created Aug 11, 2021
Sign in with Slack (OpenID Connect) Example App in Kotlin
View MyApp.kt
import com.auth0.jwt.JWT
import com.slack.api.Slack
import com.slack.api.bolt.App
import com.slack.api.bolt.jetty.SlackAppServer
fun main() {
System.setProperty("", "debug")
// export SLACK_CLIENT_ID=
seratch / MyApp.kt
Last active May 23, 2021
Send Slack saved Items to Notion Database
View MyApp.kt
import com.slack.api.Slack
import com.slack.api.bolt.App
import com.slack.api.bolt.AppConfig
import com.slack.api.bolt.jetty.SlackAppServer
import com.slack.api.model.event.StarAddedEvent
import notion.api.v1.NotionClient
import notion.api.v1.http.JavaNetHttpClient
import notion.api.v1.logging.Slf4jLogger
import notion.api.v1.model.common.PropertyType
import notion.api.v1.model.common.RichTextLinkType
seratch / Dockerfile
Last active May 20, 2021
Bolt for Python: AWS App Runner Example
View Dockerfile
FROM python:3.9.5-slim-buster
COPY requirements.txt /app/
COPY /app/
RUN pip install -r requirements.txt
CMD python /app/
seratch /
Last active Dec 3, 2021
Sign in with Slack - the simplest example

You can run this app by following the steps below:

Set up your Slack app

  • Create a new Slack app from
  • Go to OAuth & Permissions
    • Add identity.basic & to User Token Scopes
    • Add OAuth Redirect URL
  • Go to Basic Information
    • Grab the Client ID & Client Secret in the page
seratch /
Last active Apr 16, 2021
Two Slack App Installation Flow Example (Flask + SQLAlchemy)
import logging
from typing import Callable
import os
from slack_bolt import App, BoltContext, Ack
from slack_bolt.adapter.flask import SlackRequestHandler
from slack_bolt.oauth.oauth_settings import OAuthSettings
seratch / Dockerfile
Last active Oct 7, 2021
Slack OAuth App Example (Google Cloud Run + Datastore)
View Dockerfile
FROM python:3.9.2-slim-buster
# Allow statements and log messages to immediately appear in the Knative logs
# Copy local code to the container image.
COPY . ./
seratch /
Created Feb 18, 2021
Slack App in Google Apps Script
// *** Request Verification ***
// The currently recommended way is to verify request signature:
// Unfortunately, GAS web apps don"t have means to access request headers. Thus, this example uses the old way to verify requests.
// >>> Settings > Basic Information > App Credentials > Verification Token
const legacyVerificationToken = PropertiesService.getScriptProperties().getProperty("SLACK_VERIFICATION_TOKEN");
// *** OAuth Access Token ***
// Install your Slack app into its development workspace.
// >>> Settings > Install App > Bot User OAuth Access Token
const token = PropertiesService.getScriptProperties().getProperty("SLACK_BOT_TOKEN");
seratch / go.mod
Last active Apr 5, 2021
Slack Socket Mode in Go
View go.mod
module socket-mode-app
go 1.15
require v0.8.0
seratch /
Created Dec 23, 2020
Minecraft Forge 1.16 Mod that can call Slack APIs
package com.github.seratch.slack_mod;
import com.slack.api.Slack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
seratch /
Last active Nov 16, 2020
Slack usergroup select menu
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt

export SLACK_BOT_TOKEN=(your own value)
export SLACK_SIGNING_SECRET=(your own value)