Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Commit bd763ca

Browse files
committed
objects: make all fields optional
1 parent 6601a5f commit bd763ca

File tree

3 files changed

+147
-137
lines changed

3 files changed

+147
-137
lines changed

examples/listen-for-events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ async def main():
2828

2929
async def on_event(event: RealTimeEventStreamEvent):
3030
print("MESSAGE")
31-
if event.event:
32-
print("REDACTION?", event.event.event_content.message_event.recalled_at)
31+
if (e := event.event) and (ec := e.event_content) and (me := ec.message_event):
32+
print("REDACTION?", me.recalled_at)
3333
print(event)
3434

3535
async def on_reaction(event: RealTimeEventStreamEvent):

0 commit comments

Comments
 (0)