From c95ff81b4fced35a329493ca593a0c9a0610e4a1 Mon Sep 17 00:00:00 2001 From: rebecca Date: Sun, 13 Sep 2026 16:43:50 +0100 Subject: oops --- discord/pylon.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'discord') diff --git a/discord/pylon.lua b/discord/pylon.lua index 1eb0a5a..3281c53 100644 --- a/discord/pylon.lua +++ b/discord/pylon.lua @@ -36,6 +36,7 @@ function Discord._req(self, url, payload) local status = head:get':status' local bod = body:get_body_as_string() assert(status:match"^2", 'status was '..status..' body '..bod) + if #bod == 0 then return nil end local val, _, err = json.decode(bod) if err then error(err) else return val end end @@ -127,7 +128,7 @@ function Discord.sending(self) for dest_channel, message in self.inbox:iter() do self.log:proto('>',dest_channel,message.sender,message.body) local wh = self.channel_to_webhook[dest_channel.descriptor] - self._req('webhooks/'..wh.id..'/'..wh.token, { + self:_req('webhooks/'..wh.id..'/'..wh.token, { username = message.sender, content = message.body, }) -- cgit v1.2.3