All Projects → SwiftBlocksUI → Swiftblocksui

SwiftBlocksUI / Swiftblocksui

Licence: apache-2.0
Develop interactive Slack messages and modals using a SwiftUI like declarative style

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Swiftblocksui

Cabal Desktop
Desktop client for Cabal, the p2p/decentralized/local-first chat platform.
Stars: ✭ 632 (+2428%)
Mutual labels:  slack
Auto Like My Gf Insta Pic
Bot to automatically like your friend's Instagram post and notify you on Slack
Stars: ✭ 773 (+2992%)
Mutual labels:  slack
Torpedo
Pluggable, multi-network asynchronous chat bot written in Go
Stars: ✭ 19 (-24%)
Mutual labels:  slack
Awesome Slack
A curated list of awesome Slack related things
Stars: ✭ 695 (+2680%)
Mutual labels:  slack
Notify
A dead simple Go library for sending notifications to various messaging services.
Stars: ✭ 727 (+2808%)
Mutual labels:  slack
Vigil
🚦 Microservices Status Page. Monitors a distributed infrastructure and sends alerts (Slack, SMS, etc.).
Stars: ✭ 804 (+3116%)
Mutual labels:  slack
Hedwig
An Adapter-based Bot Framework for Elixir Applications
Stars: ✭ 609 (+2336%)
Mutual labels:  slack
Nyc
🏙 New York, NY
Stars: ✭ 23 (-8%)
Mutual labels:  slack
Slacktee
slacktee is a bash script that works like tee command. Instead of writing the standard input to files, slacktee posts it to Slack.
Stars: ✭ 772 (+2988%)
Mutual labels:  slack
Manamoji Slack
Slack emojis for Magic card symbols. Used by Scryfall’s Slack bot.
Stars: ✭ 16 (-36%)
Mutual labels:  slack
Metabase
The simplest, fastest way to get business intelligence and analytics to everyone in your company 😋
Stars: ✭ 26,803 (+107112%)
Mutual labels:  slack
Integrations
Connect your App to Multiple Messaging Channels with the W3C Open standard.
Stars: ✭ 721 (+2784%)
Mutual labels:  slack
Jirachat
JIRA Webhook handler that forwards to Hipchat and Slack
Stars: ✭ 6 (-76%)
Mutual labels:  slack
Aiva
AIVA (A.I. Virtual Assistant): General-purpose virtual assistant for developers.
Stars: ✭ 693 (+2672%)
Mutual labels:  slack
Slack
🎉✨ Slack API client for Node and browsers.
Stars: ✭ 903 (+3512%)
Mutual labels:  slack
Slack Plugin
A Jenkins plugin for posting notifications to a Slack channel
Stars: ✭ 628 (+2412%)
Mutual labels:  slack
Inventory Hunter
⚡️ Get notified as soon as your next CPU, GPU, or game console is in stock
Stars: ✭ 778 (+3012%)
Mutual labels:  slack
Yii2 Slack Log
Pretty Slack log target for Yii 2
Stars: ✭ 24 (-4%)
Mutual labels:  slack
Whatis
Whatis bot server for Slack!
Stars: ✭ 22 (-12%)
Mutual labels:  slack
Reviewet
Getting App Store and Google Play's review and notify to either slack or email.
Stars: ✭ 7 (-72%)
Mutual labels:  slack

SwiftBlocksUI

SwiftBlocksUI is a way to write interactive Slack messages and modal dialogs (also known as Slack "applications") using a SwiftUI like declarative style.

A blog article containing SwiftBlocksUI tutorials: Instant “SwiftUI” Flavoured Slack Apps.

This is what a full application looks like:

#!/usr/bin/swift sh
import SwiftBlocksUI // @SwiftBlocksUI

dotenv.config()

struct ClipItView: Blocks {

  @State(\.messageText) var messageText
  @State var importance = "medium"
  
  var body: some Blocks {
    View("Save it to ClipIt!") {
      TextEditor("Message Text", text: $messageText)
      
      Picker("Importance", selection: $importance) {
        "High 💎💎✨".tag("high")
        "Medium 💎"  .tag("medium")
        "Low ⚪️"     .tag("low")
      }
      
      Submit("CliptIt") {
        console.log("Clip:", messageText, importance)
      }
    }
  }
}

struct ClipIt: App {

  var body: some Endpoints {
    Use(logger("dev"), bodyParser.urlencoded(),
        sslCheck(verifyToken(allowUnsetInDebug: true)))
        
    MessageAction("clipit") {
      ClipItView()
    }
  }
}

try ClipIt.main()

Documentation

There is a related blog entry going over SwiftBlocksUI: Instant “SwiftUI” Flavoured Slack Apps.

Additional documentation is going to arrive within this repository: Documentation.

Examples:

  • SlashCows - Slack slash command that produces ASCII Cows. Moo!
  • AvocadoToast - An Avocado Toast ordering solution.
  • ClipIt! - Working on Messages.

Environment Variables

  • SLACK_ACCESS_TOKEN (the token required to send requests to Slack)
  • SLACK_VERIFICATION_TOKEN (shared secret with Slack to verify requests)
  • PORT (the port the app is going to start on, defaults to 1337)
  • LOG_SLACK_CLIENT_POSTS (set to 1 to log the JSON sent to Slack using SlackClient)
  • blocks.log.blocks (yes to log the structure of outgoing API blocks)
  • blocks.log.blocks.json (yes to log the raw JSON of outgoing blocks)
  • macro.core.numthreads
  • macro.core.iothreads
  • macro.core.retain.debug
  • macro.concat.maxsize
  • macro.streams.debug.rc
  • macro.router.debug
  • macro.router.matcher.debug

Requirements

On Linux this currently requires a Swift 5.3 environment (swiftc crash, might be SR-12543).

On macOS it should work with Swift 5.2 (aka Xcode 11) and up, though 5.3 has some additional conveniences.

Links

Who

SwiftBlocksUI is brought to you by the Always Right Institute and ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].