Skip to content

Commit

Permalink
Merge branch 'feature/swift4' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneQi committed Sep 30, 2017
2 parents d75dcf9 + 76bae02 commit 0a4d316
Show file tree
Hide file tree
Showing 17 changed files with 789 additions and 1,193 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ services:
- docker

script:
- sudo sh ./scripts/build.sh
- sudo bash ./docker/test.sh

notifications:
email: false
webhooks:
secure: qBLY9VOBi/W5Mf0pgLd7h79d0g+/4qRu5ClEd/C7zSLSx9XsPbC7vYZ8CALZNnR8xCrfZj1osTWcY4O/g9Wso1iWt7k9ekdQi+ze36LgxYk4ouW2p3BbxUlIgSJ38AvRCxXrb457/LK/ddi/E3/433APE78VSQU6ZMawDmdYe8L20kIhodXgJxsxMjVt+nhTjktMCRCgrXaOUz4UtfNSwiIP1Woo4L7xAnuFdhy1XmhOV1ARP8Z+smgRia00JsOBD6P+S5DLguOQ8Ri1glSer7bAJzD9eYA4pc+C/5ZvgJ8sqH8Le/2LR8XFhH6Pg+d3r+6VPfOXc20sXmRXgFT8SUQCCnzQ4pqsC4vRijsD1ZLkHMCYw3lbF4u4JTwYquDmwb9CRvPNA9bFepbMbVR65g8ox9RzAQu3Z9oXrtI/IDRMEjNP3mgHopt6IzqdHvcmHxnhYiu5GH9fw1ZQLC/wSsecH6hI6dKJ6zQwnjtyJIFkfMOetknmvAFlMo/HN3YH8NBCeGsvFKPJ698fG1gOWuBsIdMz/LqavmSSBKD05J47OnxMlI41Pf1uxdo5Q0jAzMlJaC1IFc4bawN23N1wtw/XClA32XPxsirZWKfrOKo1jPYw5R5DP7BcwCP+Y8pEEQqqbeML5gqhXKmsUV9ilHqD5s9Lju3E+Ig7k/RUKws=
20 changes: 20 additions & 0 deletions Example/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// main.swift
// ZEGBotExample
//
// Created by Shane Qi on 9/28/17.
//

import ZEGBot
import Foundation

let bot = ZEGBot(token: "TYPE YOUR TOKEN HERE")

bot.run { updateResult, bot in
switch updateResult {
case .success(let update):
dump(update)
case .failure(let error):
dump(error)
}
}
12 changes: 0 additions & 12 deletions Package.pins

This file was deleted.

27 changes: 24 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
// swift-tools-version:4.0

import PackageDescription

let package = Package(
name: "ZEGBot",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/SwiftyJSON.git", majorVersion: 15)
]
products: [
.library(
name: "ZEGBot",
targets: ["ZEGBot"]),
.executable(
name: "ZEGBotExample",
targets: ["ZEGBotExample"])
],
dependencies: [],
targets: [
.target(
name: "ZEGBot",
dependencies: [],
path: "./Sources"),
.target(
name: "ZEGBotExample",
dependencies: ["ZEGBot"],
path: "./Example"),
.testTarget(
name: "ZEGBotTests",
dependencies: ["ZEGBot"]),
]
)
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ZEGBot

[![Build Status](https://travis-ci.org/ShaneQi/ZEGBot.svg?branch=master)](https://travis-ci.org/ShaneQi/ZEGBot) ![Swift Version](https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat) ![Platforms](https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-lightgray.svg?style=flat) ![License](https://img.shields.io/badge/License-Apache-lightgrey.svg?style=flat)
[![Build Status](https://travis-ci.org/ShaneQi/ZEGBot.svg?branch=master)](https://travis-ci.org/ShaneQi/ZEGBot) [![Swift Version](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://swift.org) ![Platforms](https://img.shields.io/badge/Platforms-OS%20X%20%7C%20Linux%20-blue.svg?style=flat) ![License](https://img.shields.io/badge/License-Apache-red.svg?style=flat)

This library wraps the JSON decoding processing, making it easy to decode incoming JSON String to manipulatable objects.

Expand All @@ -11,11 +11,11 @@ This library wraps the processing of converting objects to Telegram Bot API requ
Add this project as a dependency in your Package.swift file.

```swift
.Package(url: "https://github.com/shaneqi/ZEGBot.git", majorVersion: 2)
.package(url: "https://github.com/shaneqi/ZEGBot.git", from: Version(4, 0, 0))
```
## Quick Start

[ZEGBot-Template](https://github.com/ShaneQi/ZEGBot-Template) - an empty starter project.
Checkout the example here: [./Example](https://github.com/ShaneQi/ZEGBot/tree/master/Example).

Or you can just put the following code into `main.swift` of your project.

Expand Down
Loading

0 comments on commit 0a4d316

Please sign in to comment.