Skip to content

Commit cf3985d

Browse files
authored
[#220] Fix docs code sample for listening to events
* Minor documentation correction in event examples * Added back closing tag for details
1 parent 01894d7 commit cf3985d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docs/_basic/listening_events.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ The `event()` method requires an `eventType` of type `str`.
1717
# When a user joins the team, send a message in a predefined channel asking them to introduce themselves
1818
@app.event("team_join")
1919
def ask_for_introduction(event, say):
20-
welcome_channel_id = "C12345";
21-
user_id = event["user"]["id"]
20+
welcome_channel_id = "C12345"
21+
user_id = event["user"]
2222
text = f"Welcome to the team, <@{user_id}>! 🎉 You can introduce yourself in this channel."
2323
say(text=text, channel=welcome_channel_id)
2424
```
@@ -46,5 +46,4 @@ def log_message_change(logger, event):
4646
user, text = event["user"], event["text"]
4747
logger.info(f"The user {user} changed the message to {text}")
4848
```
49-
5049
</details>

0 commit comments

Comments
 (0)