diff options
| author | rebecca <ubq323@ubq323.website> | 2026-09-13 16:43:50 +0100 |
|---|---|---|
| committer | rebecca <ubq323@ubq323.website> | 2026-09-13 16:43:50 +0100 |
| commit | c95ff81b4fced35a329493ca593a0c9a0610e4a1 (patch) | |
| tree | 3e3bf7221bb53093e7b0a6beaf49d7a84713cd57 /discord/pylon.lua | |
| parent | ee4865d8e0c2ba3f29a449b04c5ccb04320c514d (diff) | |
oops
Diffstat (limited to 'discord/pylon.lua')
| -rw-r--r-- | discord/pylon.lua | 3 |
1 files changed, 2 insertions, 1 deletions
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, }) |
