Last active
July 22, 2020 17:00
-
-
Save erkin/8281e8e0c4d960b108ef682a2b4f2d95 to your computer and use it in GitHub Desktop.
Minimal Discord webhook client (text-only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require net/http-client json) | |
(define webhook-id "foo") | |
(define webhook-token "bar") | |
(module+ main | |
(http-conn-send! | |
(http-conn-open "discord.com" #:ssl? #t) | |
(string-append "/api/webhooks/" webhook-id "/" webhook-token) | |
#:method #"POST" | |
#:headers '("Content-Type: application/json") | |
#:data (jsexpr->string (hasheq 'content (read-string 2000))) | |
#:close? #t)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment