~williewillus/r16

d426a80d250ecf346b24cbc5a1b12fd72908c378 — Vincent Lee 10 days ago 8a5cd13 master
Expose replied-to message contents
2 files changed, 10 insertions(+), 1 deletions(-)

M frontends/discord.rkt
M scribblings/r16.scrbl
M frontends/discord.rkt => frontends/discord.rkt +6 -1
@@ 193,7 193,6 @@

      (define (fetch-attachment attachments index)
        (let/cc return
          (define chan (make-channel))
          (when (>= index (length attachments))
            (return #f))
          (define attachment (list-ref attachments index))


@@ 247,6 246,11 @@
          (do-delete-message message))
        (void))

      (define reply-contents
        (and~> message
               (hash-ref 'referenced_message #f)
               (hash-ref 'content #f)))

      (lambda (base trick-obj _args _parent-context)
        `(((message-contents       . ,message-contents)
           (message-author         . ,message-author)


@@ 261,6 265,7 @@
           (open-reply-attachment  . ,open-reply-attachment)
           (attachment-count       . ,attachment-count)
           (reply-attachment-count . ,reply-attachment-count)
           (reply-contents         . ,reply-contents)
           ,@(car base))
          ,@(cdr base))))


M scribblings/r16.scrbl => scribblings/r16.scrbl +4 -0
@@ 166,3 166,7 @@ The number of files attached to the message that invoked this sandbox.
@defthing[reply-attachment-count natural?]{
The number of files attached to the message that the invoking message replied to.
}

@defthing[reply-contents (or/c string? #f)]{
The full message content of the message that the invoking message replied to.
}
\ No newline at end of file