rapierorg / telegram-bot-swift

Telegram Bot SDK for Swift (unofficial)
https://github.com/rapierorg/telegram-bot-swift/wiki
Apache License 2.0
374 stars 63 forks source link

No such module 'SwiftyJSON' #1

Closed qadirsuh closed 8 years ago

qadirsuh commented 8 years ago

Got screen shot 2016-04-01 at 5 26 01 pm

telegram-bot-swift-master/Source/Types/Document.swift:11:8: No such module 'SwiftyJSON'

zmeyc commented 8 years ago

Run: git submodule init git submodule update This will download SwiftyJSON.

Then run ./amalgamate.swift

This will pack the entire library into single TelegramBot.swift file which can be added to any projects without other dependencies.

qadirsuh commented 8 years ago

How to do following step

Then run ./amalgamate.swift

zmeyc commented 8 years ago
bash$ ./amalgamate.swift
TelegramBot.swift created succesfully
44 file(s) added, 70 file(s) skipped
qadirsuh commented 8 years ago

I am on mac.

I am doing like this and getting error. any suggestion

Qadirs-Mac-mini:telegram-bot-swift-master qadirhussain$ bash amalgamate.swift 
amalgamate.swift: line 3: import: command not found
amalgamate.swift: line 5: syntax error near unexpected token `('
amalgamate.swift: line 5: `func main() -> Int32 {'
zmeyc commented 8 years ago

Passing it as an argument to bash won't work, it's not a bash script. Try: swift amalgamate.swift

But ./amalgamate.swift should work as well if runned from Terminal.

If it doesn't work, check Swift version by calling: /usr/bin/env swift from Terminal.

It should print:

Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance.

zmeyc commented 8 years ago

By the way, is the example project working?

qadirsuh commented 8 years ago

I done as you said. here is my log `Qadirs-Mac-mini:telegram-bot-swift qadirhussain$ swift amalgamate.swift amalgamate.swift:43:4: warning: '++' is deprecated: it will be removed in Swift 3 ++skipped ^~ += 1 amalgamate.swift:56:4: warning: '++' is deprecated: it will be removed in Swift 3 ++skipped ^~ += 1 amalgamate.swift:70:4: warning: '++' is deprecated: it will be removed in Swift 3 ++skipped ^~ += 1 amalgamate.swift:82:3: warning: '++' is deprecated: it will be removed in Swift 3 ++added ^~ += 1 Added: Source/BotName.swift Skipping (ext): Source/Categories Added: Source/Categories/JSON+Utils.swift Added: Source/Categories/NSScanner+Swift.swift Added: Source/Categories/NSURLSessionDataTask+AssociatedData.swift Added: Source/Categories/Optional+Unwrap.swift Added: Source/Categories/String+HTTP.swift Added: Source/Categories/String+Indent.swift Added: Source/Categories/String+Trim.swift Added: Source/DataTaskError.swift Added: Source/ForceReply.swift Added: Source/HTTPUtils.swift Skipping (ext): Source/Info.plist Added: Source/ReplyKeyboardHide.swift Skipping (ext): Source/Requests Added: Source/Requests/TelegramBot+getMe.swift Added: Source/Requests/TelegramBot+getUpdates.swift Added: Source/Requests/TelegramBot+sendMessage.swift Skipping (ext): Source/Router Added: Source/Router/Argument.swift Added: Source/Router/Arguments.swift Added: Source/Router/Parameter.swift Skipping (ext): Source/Router/Parameters Added: Source/Router/Parameters/Command.swift Added: Source/Router/Parameters/RestOfString.swift Added: Source/Router/Parameters/String+Parameter.swift Added: Source/Router/Parameters/Word.swift Added: Source/Router/Path.swift Added: Source/Router/Router.swift Added: Source/String+ExtractBotCommand.swift Added: Source/TaskAssociatedData.swift Added: Source/TelegramBot+Utils.swift Skipping (ext): Source/TelegramBot.h Added: Source/TelegramBot.swift Skipping (ext): Source/ThirdParty Skipping (ext): Source/ThirdParty/SwiftyJSON Skipping (ext): Source/Types Added: Source/Types/Audio.swift Added: Source/Types/Contact.swift Added: Source/Types/Document.swift Added: Source/Types/GroupChat.swift Added: Source/Types/Location.swift Added: Source/Types/Message.swift Added: Source/Types/PhotoSize.swift Added: Source/Types/ReplyKeyboardMarkup.swift Added: Source/Types/ReplyMarkup.swift Added: Source/Types/Response.swift Added: Source/Types/Sticker.swift Added: Source/Types/Update.swift Added: Source/Types/User.swift Added: Source/Types/UserOrGroupChat.swift Added: Source/Types/Video.swift

TelegramBot.swift created succesfully 43 file(s) added, 9 file(s) skipped`

But still I am getting the same error "/Users/qadirhussain/Desktop/telegram-bot-swift/telegram-bot-swift/Source/Types/Document.swift:11:8: No such module 'SwiftyJSON'" :(

zmeyc commented 8 years ago

Which version of Xcode do you use? Probably SwiftyJSON doesn't compile on newer Xcode and needs to be updated, I'll check this.

qadirsuh commented 8 years ago

I am using the xCode Version 7.3 (7D175)

zmeyc commented 8 years ago

I updated the lib to use Swift 3.0 and Swift Package Manager, README now contains build instructions and a link to example project. Please note that the lib is still very unpolished and lacks documentation. If you'll try the latest version please let me know if it compiles.

zmeyc commented 8 years ago

@qadirsuh added documentation to the wiki: https://github.com/zmeyc/telegram-bot-swift/wiki

I'm closing the ticket, if you need help, feel free to reopen.

qadirsuh commented 8 years ago

Thanks for this. I will check it out and let you know :)