Handle missing disruption messages
This commit is contained in:
parent
9c46c0c552
commit
f2defe4ad7
1 changed files with 7 additions and 4 deletions
11
sncf.ss
11
sncf.ss
|
@ -122,10 +122,13 @@
|
|||
(unless (null? disruptions)
|
||||
(displayln "Perturbations :"))
|
||||
(for ((dis disruptions))
|
||||
(if (eq? style 'markdown)
|
||||
(display "* ")
|
||||
(display "• "))
|
||||
(displayln (hash-ref (car (hash-ref dis 'messages)) 'text))))
|
||||
(let ((messages (hash-ref dis 'messages '())))
|
||||
(if (eq? style 'markdown)
|
||||
(display "* ")
|
||||
(display "• "))
|
||||
(if (null? messages)
|
||||
(displayln "[Pas de message]")
|
||||
(displayln (hash-ref (car messages) 'text))))))
|
||||
|
||||
(def (post-to-mattermost url text channel: (channel #f))
|
||||
(def data (list->hash-table `((text . ,text))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue