Skip to content

Commit a5ca302

Browse files
authored
Merge pull request #26 from nanato12/update-0.1.1
Update 0.1.1
2 parents 4099b30 + 0d90c70 commit a5ca302

File tree

2 files changed

+48
-26
lines changed

2 files changed

+48
-26
lines changed

Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
[package]
22
name = "line-bot-sdk-rust"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["nanato12 <[email protected]>"]
55
edition = "2018"
66
description = "LINE Messaging API SDK for Rust"
77
readme = "README.md"
88
repository = "https://github.com/nanato12/line-bot-sdk-rust/"
9-
license = "Apache-2.0"
109
license-file = "LICENSE"
1110
keywords = ["line", "linebot", "line-bot-sdk", "line-messaging-api"]
1211
categories = ["api-bindings"]

README.md

+47-24
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ If you use `rocket support`.
1717
[dependencies]
1818
line-bot-sdk-rust = { version = "0.1", features = ["rocket_support"] }
1919
```
20+
If you use `actix_web support`.
21+
```
22+
[dependencies]
23+
line-bot-sdk-rust = { version = "0.1", features = ["actix_support"] }
24+
```
2025
## Configuration
2126
```
2227
extern crate line_bot_sdk_rust as line;
@@ -28,39 +33,57 @@ fn main() {
2833
```
2934
## How to use
3035
The LINE Messaging API uses the JSON data format.
31-
parse_event_request() will help you to parse the HttpRequest content and return a Result<[Events](`events::Events`) , &'static str> Object.
32-
```
36+
parse_event_request() will help you to parse the HttpRequest content and return a Result<[Events](`events::Events`) , &'static str> Object.
37+
```
3338
let result: Result<Events, &'static str> =
3439
bot.parse_event_request(signature, body);
35-
```
40+
```
41+
42+
```
43+
match result {
44+
Ok(events) => {
45+
for event in events.events {
46+
...
47+
}
48+
}
49+
Err(msg) => {}
50+
}
51+
```
3652

37-
```
38-
match result {
39-
Ok(events) => {
40-
for event in events.events {
41-
...
42-
}
43-
}
44-
Err(msg) => {}
45-
}
46-
```
53+
## EchoBot examples
54+
55+
**with Rocket framework**
56+
57+
```bash
58+
cargo run --example echobot_rocket --features=rocket_support
59+
```
60+
61+
source: [rocket example](./examples/echobot_rocket.rs)
62+
63+
**with Actix_web framework**
64+
65+
```bash
66+
cargo run --example echobot_actix_web --features=actix_support
67+
```
68+
69+
source: [actix_web example](./examples/echobot_actix_web.rs)
4770

4871
## Contributing
4972
Please make a contribution 😆
5073

5174
## License
5275
```
53-
Copyright 2021 nanato12
76+
Copyright 2021 nanato12
5477
55-
Licensed under the Apache License, Version 2.0 (the "License");
56-
you may not use this file except in compliance with the License.
57-
You may obtain a copy of the License at
78+
Licensed under the Apache License, Version 2.0 (the "License");
79+
you may not use this file except in compliance with the License.
80+
You may obtain a copy of the License at
5881
59-
http://www.apache.org/licenses/LICENSE-2.0
82+
http://www.apache.org/licenses/LICENSE-2.0
6083
61-
Unless required by applicable law or agreed to in writing, software
62-
distributed under the License is distributed on an "AS IS" BASIS,
63-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
64-
See the License for the specific language governing permissions and
65-
limitations under the License.
66-
```
84+
Unless required by applicable law or agreed to in writing, software
85+
distributed under the License is distributed on an "AS IS" BASIS,
86+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
87+
See the License for the specific language governing permissions and
88+
limitations under the License.
89+
```

0 commit comments

Comments
 (0)