From 71cee0014368f5d83fe94989526a4ffb2824f50c Mon Sep 17 00:00:00 2001 From: rebecca Date: Thu, 24 Sep 2026 17:20:42 +0100 Subject: change fields on Message to include author --- discord/pylon.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'discord/pylon.lua') diff --git a/discord/pylon.lua b/discord/pylon.lua index 70c6a40..f035fbc 100644 --- a/discord/pylon.lua +++ b/discord/pylon.lua @@ -132,8 +132,9 @@ function Discord.handle_dispatch(self, event) and d.author.id ~= self.channel_to_webhook[d.channel_id].id and d.author.id ~= self.bot_id then - self.wilson:deliver({ - channel = Thing(self, d.channel_id, 'channel name here'), + self.wilson:deliver(Message { + pylon = self, + channel = Thing(self, d.channel_id, 'TODO discord channel names'), author = Thing(self, d.author.id, d.author.username), body = d.content, }) @@ -143,10 +144,10 @@ end function Discord.sending(self) for dest_channel, message in self.inbox:iter() do - self.log:proto('>',dest_channel,message.sender,message.body) + self.log:proto('>',dest_channel,message.author,message.body) local wh = self.channel_to_webhook[dest_channel.id] self:_req('webhooks/'..wh.id..'/'..wh.token, { - username = message.sender.." ["..message.source_channel.pylon.shortname.."]", + username = message.author:name_with_shortname(), content = message.body, }) end -- cgit v1.2.3