summaryrefslogtreecommitdiff
path: root/discord/the.lua
diff options
context:
space:
mode:
authorrebecca <ubq323@ubq323.website>2026-09-13 16:37:17 +0100
committerrebecca <ubq323@ubq323.website>2026-09-13 16:37:17 +0100
commitee4865d8e0c2ba3f29a449b04c5ccb04320c514d (patch)
tree8fa3ea7e8f09e3affef29e5cce3b197d6ea4cbfa /discord/the.lua
parent8e813cf9a21c78fbcd4053bc886b8edaea8dcf59 (diff)
use regular _req for executing webhook
Diffstat (limited to 'discord/the.lua')
-rw-r--r--discord/the.lua24
1 files changed, 0 insertions, 24 deletions
diff --git a/discord/the.lua b/discord/the.lua
deleted file mode 100644
index d3aaf58..0000000
--- a/discord/the.lua
+++ /dev/null
@@ -1,24 +0,0 @@
-local http_request = require'http.request'
-local dkjson = require'dkjson'
-
-local function exec_webhook(url, payload, debug)
- local req = http_request.new_from_uri(url)
- req.headers:upsert('content-type','application/json')
- req.headers:upsert(':method','POST')
- req:set_body(dkjson.encode(payload))
- local resp_head, resp_body = assert(req:go())
- local status = resp_head:get':status'
- if debug then
- resp_head:dump()
- print()
- print(resp_body:get_body_as_string())
- end
- assert(status:sub(1,1) == '2', 'status was '..status..' not 2xx')
-end
-
-return exec_webhook
--- return { grom = function(from,body) print(body) exec_webhook(url, {
--- content=body,
--- username=from,
--- }, true) end }
-