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)
python app.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://hub.docker.com/_/python | |
| FROM python:3.9.2-slim-buster | |
| # Allow statements and log messages to immediately appear in the Knative logs | |
| ENV PYTHONUNBUFFERED True | |
| # Copy local code to the container image. | |
| ENV APP_HOME /app | |
| WORKDIR $APP_HOME | |
| COPY . ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // *** Request Verification *** | |
| // The currently recommended way is to verify request signature: https://api.slack.com/authentication/verifying-requests-from-slack | |
| // 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module socket-mode-app | |
| go 1.15 | |
| require github.com/slack-go/slack v0.8.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.github.seratch.slack_mod; | |
| import com.slack.api.Slack; | |
| import com.slack.api.methods.response.chat.ChatPostMessageResponse; | |
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from slack_bolt.adapter.aws_lambda import SlackRequestHandler | |
| SlackRequestHandler.clear_all_log_handlers() | |
| import logging | |
| logging.basicConfig(format="%(asctime)s %(message)s", level=logging.DEBUG) | |
| from slack_bolt import App, Ack | |
| from slack_sdk.web import WebClient | |
| # export SLACK_BOT_TOKEN=xoxb- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.slack.api.bolt.App | |
| import com.slack.api.bolt.jetty.SlackAppServer | |
| import com.slack.api.bolt.middleware.builtin.WorkflowStep | |
| import com.slack.api.model.block.Blocks.divider | |
| import com.slack.api.model.block.Blocks.section | |
| import com.slack.api.model.block.LayoutBlock | |
| import com.slack.api.model.block.composition.BlockCompositions.plainText | |
| import com.slack.api.model.kotlin_extension.block.withBlocks | |
| import com.slack.api.model.view.Views.view | |
| import com.slack.api.model.view.Views.viewTitle |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { LogLevel } = require("@slack/logger"); | |
| const { App } = require("@slack/bolt"); | |
| const { MyExpressReceiver } = require("./receiver") | |
| const app = new App({ | |
| token: process.env.SLACK_BOT_TOKEN, | |
| logLevel: process.env.SLACK_LOG_LEVEL || LogLevel.DEBUG, | |
| receiver: new MyExpressReceiver({ | |
| signingSecret: process.env.SLACK_SIGNING_SECRET | |
| }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| source "https://rubygems.org" | |
| gem "sinatra" | |
| gem "slack-ruby-client" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package hello; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.boot.web.servlet.ServletComponentScan; | |
| @SpringBootApplication | |
| @ServletComponentScan | |
| public class Application { | |
| public static void main(String[] args) { |