Skip to content

Commit 1a6fa09

Browse files
committed
Update README.md with examples
1 parent 6245cbf commit 1a6fa09

File tree

1 file changed

+31
-15
lines changed

1 file changed

+31
-15
lines changed

README.md

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,47 @@
11
# Slackito
22

3-
A client written with result builders to work with Slack Web API.
3+
A client written with result builders to work with Slack Web API. A small part of the larger iOS deploy infrastructure at Plata.
44

55

66
## Usage
77

88

99
```swift
10-
let message = SlackMessage(channel: "test-ios-channel-2") {
11-
Header("Some header")
12-
PlainSection("A plain text example")
13-
14-
Divider()
10+
let meta = try meta(stage: stage, configPath: bundleId.configPath)
11+
12+
let message = SlackMessage(channel: channel, ts: thread) {
13+
MarkdownSection(
14+
":gitlab-success: \(meta.jobUrl) of *\(meta.appName) (\(bundleId))* has finished successfully!"
15+
)
1516

16-
FieldsSection {
17-
MarkdownSection("Section 1:\n *text 1*")
18-
MarkdownSection("Section 2:\n text 2")
17+
if let additionalMessage {
18+
Divider()
19+
MarkdownSection(additionalMessage)
1920
}
2021

2122
Context {
22-
"Branch: release"
23+
"*Branch*: \(meta.branch)"
24+
"*App version*: \(meta.version)"
25+
if let additionalContext {
26+
additionalContext
27+
}
2328
}
2429
}
2530

26-
do {
27-
try await message.send(as: {bot_token_here})
28-
} catch {
29-
print(error)
30-
}
31+
return message
3132
```
33+
34+
## Result
35+
<img width="559" height="140" alt="message_example" src="https://github.com/user-attachments/assets/3794b745-a295-4031-9491-87af0f0feb41" />
36+
37+
## Supported blocks
38+
39+
- Links
40+
- Field sections
41+
- User and group mentions
42+
- Context
43+
44+
## TODO
45+
46+
- Images
47+
- Tables

0 commit comments

Comments
 (0)