Skip to content

Instantly share code, notes, and snippets.

View pvzig's full-sized avatar

Peter Zignego pvzig

View GitHub Profile
@pvzig
pvzig / main.swift
Created June 16, 2016 02:29
Sample Slack bot implementation in Swift
import String
import SlackKit
class Leaderboard: MessageEventsDelegate {
// A dictionary to hold our leaderboard
var leaderboard: [String: Int] = [String: Int]()
let atSet = CharacterSet(characters: ["@"])
// A SlackKit client instance
let client: SlackClient
@pvzig
pvzig / Package.swift
Last active June 4, 2017 17:20
Sample Swift Package
import PackageDescription
let package = Package(
name: "Leaderbot",
targets: [],
dependencies: [
.Package(url: "https://github.com/SlackKit/SlackKit.git", majorVersion: 4),
]
)
@pvzig
pvzig / main.swift
Last active November 14, 2019 13:35
Sample Slack bot implementation in Swift
import Foundation
import SlackKit
class RobotOrNotBot {
let verdicts: [String:Bool] = [
"Mr. Roboto" : false,
"Service Kiosks": false,
"Darth Vader": false,
"K-9": true,
@pvzig
pvzig / Package.swift
Last active November 14, 2019 13:35
Sample Swift Package
// swift-tools-version:5.1
import PackageDescription
let package = Package(
name: "robot-or-not-bot",
dependencies: [
.package(url: "https://github.com/pvzig/SlackKit.git", from: "4.0.0")
],
targets: [
.target(