diff options
| author | rebecca <ubq323@ubq323.website> | 2026-09-24 17:20:42 +0100 |
|---|---|---|
| committer | rebecca <ubq323@ubq323.website> | 2026-09-24 18:55:05 +0100 |
| commit | 71cee0014368f5d83fe94989526a4ffb2824f50c (patch) | |
| tree | cd87a5c7d859d98f48866ff769ef89d60a28d5d5 /discord/pylon.lua | |
| parent | dff5363f96029aba6d0f222d3e31ab3888d7111f (diff) | |
change fields on Message to include author
Diffstat (limited to 'discord/pylon.lua')
| -rw-r--r-- | discord/pylon.lua | 9 |
1 files changed, 5 insertions, 4 deletions
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 |
