Giter Club home page Giter Club logo

slackkit's People

Contributors

allenhumphreys avatar andyksaw avatar ar4s avatar azure-pipelines[bot] avatar emorydunn avatar ffried avatar hamin avatar henry2423 avatar heyvito avatar hiragram avatar interstateone avatar johntmcintosh avatar kiancheong avatar michallaskowski avatar mtgto avatar muratayusuke avatar natestedman avatar nikkovios avatar nonchalant avatar noppefoxwolf avatar phynics avatar pvzig avatar rectalogic avatar romanpodymov avatar shimastripe avatar strogonoff avatar stucarney avatar tandinhle avatar wtimme avatar xiangxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slackkit's Issues

Swift 3.0 Migration

It would be great to start supporting the newest Swift, at least in a branch if not in master.

Compiling stuck on Client+EventDispatching.swift

here are the informations i have :

CompileSwift normal x86_64 /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Client+EventDispatching.swift
    cd /Users/kevin/swiftymanager/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Action.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Attachment.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/AttachmentField.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/AuthorizeRequest.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/AuthorizeResponse.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Bot.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Channel.swift -primary-file /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Client+EventDispatching.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Client+EventHandling.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Client+Utilities.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Client.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/ClientOptions.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Comment.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/CustomProfile.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/CustomProfileField.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/DoNotDisturbStatus.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Edited.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Event.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/EventDelegate.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Extensions.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/File.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/History.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/IncomingWebhook.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Item.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Message.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/MessageActionRequest.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/MessageActionResponder.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/MessageActionServer.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/NetworkInterface.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/OAuthResponse.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/OAuthServer.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Reaction.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Response.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Scope.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Server.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/SlackError.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/SlackKit.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Team.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/TeamIcon.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/Topic.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/User.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/UserGroup.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/WebAPI.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/WebhookRequest.swift /Users/kevin/swiftymanager/Pods/SlackKit/SlackKit/Sources/WebhookServer.swift -target x86_64-apple-macosx10.10 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -I "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/BuildProductsPath/Release/SlackKit" -F "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/BuildProductsPath/Release/SlackKit" -F "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/BuildProductsPath/Release/Starscream" -F "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/BuildProductsPath/Release/Swifter" -g -import-underlying-module -module-cache-path /Users/kevin/Library/Developer/Xcode/DerivedData/ModuleCache -D COCOAPODS -serialize-debugging-options -Xcc "-I/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/swift-overrides.hmap" -Xcc -iquote -Xcc "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/SlackKit-generated-files.hmap" -Xcc "-I/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/SlackKit-own-target-headers.hmap" -Xcc "-I/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/SlackKit-all-non-framework-target-headers.hmap" -Xcc -ivfsoverlay -Xcc "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/all-product-headers.yaml" -Xcc -iquote -Xcc "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/SlackKit-project-headers.hmap" -Xcc "-I/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/BuildProductsPath/Release/SlackKit/include" -Xcc -I/Users/kevin/swiftymanager/Pods/Headers/Private -Xcc -I/Users/kevin/swiftymanager/Pods/Headers/Public -Xcc "-I/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/DerivedSources/x86_64" -Xcc "-I/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/DerivedSources" -Xcc -DPOD_CONFIGURATION_RELEASE=1 -Xcc -DCOCOAPODS=1 -Xcc -ivfsoverlay -Xcc "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/unextended-module-overlay.yaml" -Xcc -working-directory/Users/kevin/swiftymanager/Pods -emit-module-doc-path "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/Objects-normal/x86_64/Client+EventDispatching~partial.swiftdoc" -O -module-name SlackKit -emit-module-path "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/Objects-normal/x86_64/Client+EventDispatching~partial.swiftmodule" -serialize-diagnostics-path "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/Objects-normal/x86_64/Client+EventDispatching.dia" -emit-dependencies-path "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/Objects-normal/x86_64/Client+EventDispatching.d" -emit-reference-dependencies-path "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/Objects-normal/x86_64/Client+EventDispatching.swiftdeps" -o "/Users/kevin/Library/Developer/Xcode/DerivedData/Nicolaudie_Servers_Manager-gfouokmfcjroxgcirhcjgngkaahp/Build/Intermediates/ArchiveIntermediates/Nicolaudie Servers Manager/IntermediateBuildFilesPath/Pods.build/Release/SlackKit.build/Objects-normal/x86_64/Client+EventDispatching.o"

Insane Archive Times

SlackKit took near a half hour to archive in my project, working with a maxed out 2015 MacBook Pro. I'm not sure why it is taking so long.

Can't deploy to Heroku: error: no such module 'Security'

I've been following the guide on https://medium.com/@pvzig/building-slack-bots-in-swift-b99e243e444c except I use version 3 of SlackKit. I can't deploy to Heroku because, it seems, Starscream uses the Security module which does not exist:

git push heroku master
Counting objects: 35, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (35/35), 5.21 KiB | 0 bytes/s, done.
Total 35 (delta 11), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Swift app detected
remote: Cloning into 'swiftenv'...
remote: -----> Installing 3.1
remote: Downloading https://swift.org/builds/swift-3.1-release/ubuntu1404/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu14.04.tar.gz
remote: 3.1 has been installed.
remote: -----> Installing clang-3.7.0
remote: -----> Building Package
remote: Fetching https://github.com/skagedal/SlackKit.git
remote: Fetching https://github.com/httpswift/swifter
remote: Fetching https://github.com/daltoniam/Starscream
remote: Cloning https://github.com/skagedal/SlackKit.git
remote: Resolving https://github.com/skagedal/SlackKit.git at 3.1.13-skr
remote: Cloning https://github.com/daltoniam/Starscream
remote: Resolving https://github.com/daltoniam/Starscream at 2.0.4
remote: Cloning https://github.com/httpswift/swifter
remote: Resolving https://github.com/httpswift/swifter at 1.3.3
remote: Compile Swift Module 'Starscream' (2 sources)
remote: Compile Swift Module 'Swifter' (19 sources)
remote: /tmp/build_e8e90ff420f52f7a70a284ccea0500f4/.build/checkouts/Starscream-5563129366508893404/Source/SSLSecurity.swift:24:8: error: no such module 'Security'
remote: import Security
remote:        ^

Symbol ">" return an "invalidArgName" error

Hi,

I'm building a Slack Bot and when I try to send a text that contains the symbol >, I got the value invalidArgName in the failure closure of client.webAPI.sendMessage.

Example of code :

client.webAPI.sendMessage(myChannel, text: myMessage,
	username: myUsername, asUser: true, linkNames: true,
	iconEmoji: myEmoji, success: nil, failure: { (msg) in
		print("send Error:\(msg)")
})

Output :
send Error:invalidArgName

I don't have this issue with other symbols (<, @, ...) and when I do the request with cURL, it works.

$> curl -X GET -H "Cache-Control: no-cache" -H "Postman-Token: $TOKEN" "https://slack.com/api/chat.postMessage?token=$TOKEN&channel=$CHANNEL&text=>&parse=full&link_names=1&unfurl_links=true&unfurl_media=false&username=$NAME&as_user=true&icon_url=&icon_emoji=$EMOJI"

{"ok":true,"channel":"$CHANNEL","ts":"xxxxxxxxxx.xxxxxx","message":{"type":"message","user":"$USER","text":"&lt;","bot_id":"$BOTID","ts":"xxxxxxxxxx.xxxxxx"}}

Do you have an idea to resolve this?
Thanks!

Can't get client to connect...

Here's my code to start a RTM connection as per readme:

....
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,MessageEventsDelegate {
...
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
....
        let options = ClientOptions(pingInterval: 2, timeout: 5, reconnect: true)
        let bot = SlackKit(withAPIToken:xoxp-xxxxxxxxx,clientOptions: options)
        bot.onClientInitalization = { (client: Client) in
            print(client)
            print(client.connected)
            DispatchQueue.main.async(execute: {
                client.messageEventsDelegate = self
            })
        }
        print(bot)
.....
    // MARK: MessageEventsDelegate
    func received(_ message: Message, client: Client) {
        print(message)
    }
    
    func connected(_ client: Client) {
        print(client)
    }

client.connected is always returning false
what gives?

edit: ok I got the above code to work by adding this client.connect()
in the onClientInit block....
and it prints in the received func the last received msg....
but How do i receive all subsequent messages while the client is connected?

Carthage Crash...." error: no such module 'Swifter'"

/Users/Shared/xxxx/frontend/apps/ios/xxxxx/Carthage/
Checkouts/slackkit/SlackKit/Sources/OAuthServer.swift:25:8: 
error: no such module 'Swifter'
import Swifter
       ^

** BUILD FAILED **

I'm using zirinisp/slackkit branch: swift3-GM

CDispatch dependency

Hi there! Just tried to install SlackKit using Swift Package Manager, and your Starscream fork declares a dependency of CDispatch, which does not seem to be available anymore. Do you plan to update the fork, use the mainstream repository of the mentioned package, or is there a workaround on this issue?

Thanks!

Model has failable initializers, but they not return nil

Models (like Client, Channel and other) have failable initializers init?, but they do not return nil. Instead, they have all properties optional.
I wonder if the structs could have non-failable initializers instead, which would also affect types return in success closures - the result would not be an optional. And it would be easier to deal with the result in client applications.

If you are ok with the change, I could create a new PR.

Slash Command Implementation

Hello!

Is there an example anywhere demonstrating how to properly setup a slash command? I'm looking into using SlackKit for this side project and I'm happy to append documentation and submit a PR. What exactly is the route? When initializing the WebhookServer? The token I'm assuming is the Verification Token for your app. I'm using ngrok for now FYI.

Thanks for your help.

How do you call WebAPI.channelHistory function?

How do i properly call this function...

    public func channelHistory(id: String, latest: String = "\(Date().timeIntervalSince1970)", oldest: String = "0", inclusive: Bool = false, count: Int = 100, unreads: Bool = false, success: ((_ history: History)->Void)?, failure: FailureClosure?) {
        history(.channelsHistory, id: id, latest: latest, oldest: oldest, inclusive: inclusive, count: count, unreads: unreads, success: {(history) in
            success?(history)
        }) {(error) in
            failure?(error)
        }
    }

or 

       channelHistory(String, success: <((History) -> Void)?, failure: <WebAPI.FailureClosure?>)

I Have this...but not working.

open class RealmManager {
    
    fileprivate init() {}
    static let shared = RealmManager()
    let slackWebApiClient = WebAPI(token:"xxxxxxxx")
    ........

func someFunction {
self.slackWebApiClient.channelHistory(res.destinationSlackChannelId, success: {(history: History) in
                    Log.info?.message("\(history)")
                    Log.info?.message("\(history.messages)")
                }, failure:{ (error) in
                print("SlackChannelHistory error:\(error.localizedDescription)")
            })
    ...........
   }
}

How to observer changes in client?

I'm a bit confused how one would observe changes on the Client. A callback api would be appreciated. Essentially when messages are handled my client, state changes and etc. how would one go about observing these changes in a controller?

SlackKit with concurrent HTTPServer usage

Hi Peter,

I'm working on a Slack bot sample project using your super SlackKit package from the linux branch. The thing is that my project, other than managing the websocket connection with SlackKit, it also need to expose a Rest Api.

I'm trying to use Zewo for the web server and basically using SlackClient and HTTPServer on two different dispatch queue but I'm always getting a Segmentation fault 11 error.

I had to fork your SlackKit repo and rename the SlackKit Message class as SlackMessage because of a conflict with Zero Message class.

Debugging I can see the crash is on CLibVenice library on releasing a probably not available autoreleasepool.

I've tried to add an autoreleasepool on the background queue but the problem persist. Any hint on this ?

If you want to take a look at the code both SlackKit fork and Bot sample are on my git repo:

Thanks a lot,
Jacopo

Any problems running latest Swift 3 version on iOS 10 device?

I'm having nothing but trouble getting it to run on my device without crashing with bad access violations. Debugging this in Xcode 8 really isn't providing much to go on. Just want to confirm that it does work for others in Xcode 8 / Swift 3 project.

event_swift_and_new_issue_ _pvzig_slackkit

This happens literally with just creating the SlackKit object with an API token. Looks like it can't process the initial messages from Slack. But not sure why.

Related note: Carthage build will not work for me either, so I pulled in the 3 projects into a workspace and am letting it build each that way. Seems to build ok, but just this weird on device issue (works ok in simulator).

Is it me or the pod is broken

Did a pod update today and got bumped from 3.1.5 to 3.1.8
But the pods/SlackKit folder only contains the LICENSE and README.md files and nothing else.

I guess this commit 051e8dd removed the source reference and broke the pod, or am I missing something?

Add badges

Hi
Below the title please add badges for carthage compatibility, SwiftPM compatibility, pod version, Swift version, license and platform like this:
Carthage compatible SwiftPM compatible Pod Version Swift Version License MIT Plaforms

How to gain access to value from HTTP header "Retry After" ?

any way to expose the HTTP header Retry After, in order to better handling throttling?
The below is from Slack FAQs...

 The next rate limit is indicated by a HTTP header called Retry-After,
 presented in seconds to wait before attempting another request.
 If the value were 10, then you should wait 10 seconds or more before
 retrying that request.

Programmatically / Manually Disconnect

I've been using SlackKit happily for a while now but have not found a satisfactory way to close the connection... is there a recommendation or best practice for this?

Cannot deploy to heroku

As soon as I add SlackKit as a dependency to the Package.swift

.Package(url: "https://github.com/pvzig/SlackKit.git", majorVersion: 3)

Everything works locally but when I try to deploy to heroku with this buildpack https://github.com/kylef/heroku-buildpack-swift

I have this error :

remote: Cloning into 'swiftenv'...
remote: -----> Installing 3.1
remote: Downloading https://swift.org/builds/swift-3.1-release/ubuntu1604/swift-3.1-RELEASE/swift-3.1-RELEASE-ubuntu16.04.tar.gz
remote: 3.1 has been installed.
remote: -----> Building Package
remote: fatal error: 'try!' expression unexpectedly raised an error: PackageModel.Package.Error.noManifest(baseURL: "https://github.com/pvzig/SlackKit.git", version: Optional("3.1.12")): file /home/buildnode/disk2/workspace/oss-swift-3.1-package-linux-ubuntu-16_04/swift/stdlib/public/core/ErrorType.swift, line 182
remote: Current stack trace:
remote: 0    libswiftCore.so                    0x00007fcf10d3d6b0 swift_reportError + 120
remote: 1    libswiftCore.so                    0x00007fcf10d57fc0 _swift_stdlib_reportFatalErrorInFile + 100
remote: 2    libswiftCore.so                    0x00007fcf10b524dc <unavailable> + 1189084
remote: 3    libswiftCore.so                    0x00007fcf10cea86d <unavailable> + 2861165
remote: 4    libswiftCore.so                    0x00007fcf10b51cb6 <unavailable> + 1186998
remote: 5    libswiftCore.so                    0x00007fcf10cf0780 <unavailable> + 2885504
remote: 6    libswiftCore.so                    0x00007fcf10b520ef <unavailable> + 1188079
remote: 7    libswiftCore.so                    0x00007fcf10cb1499 <unavailable> + 2626713
remote: 8    libswiftCore.so                    0x00007fcf10b51cb6 <unavailable> + 1186998
remote: 9    libswiftCore.so                    0x00007fcf10c6e610 specialized _assertionFailure(StaticString, String, file : StaticString, line : UInt, flags : UInt32) -> Never + 144
remote: 10   libswiftCore.so                    0x00007fcf10b7add5 <unavailable> + 1355221
remote: 11   swift-build                        0x00000000006602a1 <unavailable> + 2491041
remote: 12   swift-build                        0x00000000006603c6 <unavailable> + 2491334
remote: 13   swift-build                        0x00000000006419a3 <unavailable> + 2365859
remote: 14   swift-build                        0x000000000065cf64 <unavailable> + 2477924
remote: 15   swift-build                        0x00000000004591b1 <unavailable> + 364977
remote: 16   swift-build                        0x00000000006411c5 <unavailable> + 2363845
remote: 17   swift-build                        0x0000000000641ff8 <unavailable> + 2367480
remote: 18   swift-build                        0x000000000069a3d1 <unavailable> + 2728913
remote: 19   swift-build                        0x00000000006a0f2e <unavailable> + 2756398
remote: 20   swift-build                        0x00000000006932ab <unavailable> + 2699947
remote: 21   swift-build                        0x000000000069a276 <unavailable> + 2728566
remote: 22   swift-build                        0x000000000040ebc6 <unavailable> + 60358
remote: 23   libc.so.6                          0x00007fcf0ecb5740 __libc_start_main + 240
remote: 24   swift-build                        0x000000000040e9c9 <unavailable> + 59849
remote: /app/tmp/buildpacks/822b0802119468f06d891dd13d628ac251c70c982dc0461740f44eb64bd549e9b12ac39c1b08ca21f1bcf3bab7c4479d5f984ef0c1564018412c1ad0ab6822fd/bin/steps/swift-build: line 3:   419 Illegal instruction     swift build $SWIFT_BUILD_FLAGS --configuration "$SWIFT_BUILD_CONFIGURATION"
remote:  !     Push rejected, failed to compile Swift app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 

Any idea ? It drive me crazy…

How to pass around client object throughout app?

bot.onClientInitalization = { (client: Client) in
            DispatchQueue.main.async(execute: {
                client.messageEventsDelegate = self
                client.connectionEventsDelegate = self
                //send client to object cache? 
                //put client somewhere to use it again elsewhere or
               // try another design?
            })

or should i really be doing webAPI stuff here...

    func connected(_ client: Client) {
        print("\(client.connected) \("connected FromForeground")")
        //send client to object cache? 
        //put client somewhere to use it again elsewhere or
        // try another design?
    }

I see there's a few ways to get the initialized client object so that I can call WebAPI.
But how can I pass this object around the app and use it anywhere in the app?

Or is it cool to just do initialization again anywhere when I need the client object?

Disable Caching

It looks like SlackKit is caching every piece of information it sends / receives. For building a slackbot with SlackKit, I would not want it to hold all of this information in memory for its whole lifetime.

Could SlackKit have an option to disable this caching?

Autocomplete / lldb debugging not working

I'm having some issue with debugging using SlackKit.

If I create a simple project using Swift package manager, setting SlackKit as a dependency, I can compile / run the project with no issues, but autocomplete is broken. For example within the private func handleMessage(message: Message) method, "message" autocompletes to <>.

I also notice that if I put a breakpoint in that same method, none of the local variables are shown in the debugger, and if I try to po some of them it gives a bunch of warnings like this:

warning: Swift error in module robot-or-not-bot.
Debug info from this module will be unavailable in the debugger.

AppDelegate Does Not Conform To Protocol SlackEventsDelegate

I keep getting this error
and I've implemented all the methods from that protocol.

What gives....

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, MessageEventsDelegate,ConnectionEventsDelegate, SlackEventsDelegate{
    func preferenceChanged(_ preference: String, value: Any?, client: Client){print(client)}
    func userChanged(_ user: User, client: Client){print(client)}
    func presenceChanged(_ user: User, presence: String, client: Client){print(client)}
    func manualPresenceChanged(_ user: User, presence: String, client: Client){print(client)}
    func botEvent(_ bot: Bot, client: Client){print(client)}
    public func userTypingIn(_ channel: Channel, user: User, client: Client) {
        print(user)
    }

the other protocols' methods have been implemented in below un posted code...

Objective-C

Hi,

Do you have compatibility with Objective-C?

Thanks

SlackKit initialization with API Token

Hello!
Just updated to 2.0, migrated from previous version and faced a problem. I tried to initialize SlackKit with API Token of my bot, set the onClientInitalization block, but I realized, that onClientInitalization never get called. This block is nil in constructor body:
public init(withAPIToken token: String, clientOptions: ClientOptions = ClientOptions()) {}

That's why I can't get Client instance and set it's messageEventsDelegate. So, may be you will add onClientInitalization block as a parameter to costructor, or something like this?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.