Skip to content

Commit 2f92ab4

Browse files
committed
Tweak documents for consistency
1 parent ddbf7cc commit 2f92ab4

5 files changed

Lines changed: 24 additions & 25 deletions

File tree

docs/_basic/listening_actions.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,19 @@ You can use a constraints object to listen to `callback_id`s, `block_id`s, and `
3535

3636
```python
3737
# Your function will only be called when the action_id matches 'select_user' AND the block_id matches 'assign_ticket'
38-
@app.action({"action_id": "select_user", "block_id": "assign_ticket"})
39-
def update_message(ack, action, body, client):
38+
@app.action({
39+
"block_id": "assign_ticket",
40+
"action_id": "select_user"
41+
})
42+
def update_message(ack, body, client):
4043
ack()
41-
client.reactions_add(name='white_check_mark',
42-
timestamp=action['action_ts'],
43-
channel=body['channel']['id'])
44+
45+
if "container" in body and "message_ts" in body["container"]:
46+
client.reactions_add(
47+
name="white_check_mark",
48+
channel=body["channel"]["id"],
49+
timestamp=body["container"]["message_ts"],
50+
)
4451
```
4552

4653
</details>

docs/_basic/listening_events.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ You can filter on subtypes of events by passing in the additional key `subtype`.
3838

3939
```python
4040
# Matches all messages from bot users
41-
@app.event({"type": "message", "subtype": "message_changed"})
41+
@app.event({
42+
"type": "message",
43+
"subtype": "message_changed"
44+
})
4245
def log_message_change(logger, event):
43-
logger.info(f"The user {event['user']} changed the message to {event['text']}")
46+
user, text = event["user"], event["text"]
47+
logger.info(f"The user {user} changed the message to {text}")
4448
```
4549

4650
</details>

docs/_basic/listening_responding_shortcuts.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@ def open_modal(ack, shortcut, client):
3333
trigger_id=shortcut["trigger_id"],
3434
view={
3535
"type": "modal",
36-
"title": {
37-
"type": "plain_text",
38-
"text": "My App"
39-
},
40-
"close": {
41-
"type": "plain_text",
42-
"text": "Close"
43-
},
36+
"title": {"type": "plain_text", "text": "My App"},
37+
"close": {"type": "plain_text", "text": "Close"},
4438
"blocks": [
4539
{
4640
"type": "section",

docs/_basic/sending_messages.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,12 @@ def show_datepicker(event, say):
4040
if reaction == "calendar":
4141
blocks = [{
4242
"type": "section",
43-
"text": {
44-
"type": "mrkdwn",
45-
"text": "Pick a date for me to remind you"
46-
},
43+
"text": {"type": "mrkdwn", "text": "Pick a date for me to remind you"},
4744
"accessory": {
4845
"type": "datepicker",
4946
"action_id": "datepicker_remind",
5047
"initial_date": "2020-05-04",
51-
"placeholder": {
52-
"type": "plain_text",
53-
"text": "Select a date"
54-
}
48+
"placeholder": {"type": "plain_text", "text": "Select a date"}
5549
}
5650
}]
5751
say(

docs/assets/style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ span.beta {
234234
padding-bottom: 1em;
235235
}
236236

237-
.content .section-wrapper .language-javascript {
237+
.content .section-wrapper .language-python {
238238
grid-area: code;
239239
}
240240

@@ -281,7 +281,7 @@ a:hover {
281281
line-height: 1.75em;
282282
}
283283

284-
.secondary-wrapper .language-javascript {
284+
.secondary-wrapper .language-python {
285285
width: 50%;
286286
float: left;
287287
margin-top: 1em;

0 commit comments

Comments
 (0)