使用lua向不和谐的webhook发送消息

时间:2020-06-26 19:22:16

标签: lua discord webhooks

因此,我正在尝试向Lua中不和谐的Webhook发送消息。
目前,我有以下代码:

local http = require("socket.http")
ltn12 = require("ltn12")

local payload = [[ {"username":"NAME","avatar_url":"","content":"MESSAGE"} ]]

http.request
{
    url = "https://discordapp.com/api/webhooks/<redacted>",
    method = "POST",
    headers =
    {
        ["Content-Type"] = "application/json",
        ["Content-Length"] = payload:len()
    },
    source = ltn12.source.string(payload),
}

我在这里找到的:http://forum.micasaverde.com/index.php?topic=32035.0
但是消息永远不会到达。我在做什么错了?

编辑:我测试了一下,将其发送到不和谐的Webhook时似乎收到301错误代码。

0 个答案:

没有答案