summaryrefslogtreecommitdiff
path: root/discord/pylon.lua
diff options
context:
space:
mode:
authorolive <olive@olive.ooo>2026-09-17 20:29:09 +0100
committerolive <olive@olive.ooo>2026-09-17 20:29:09 +0100
commit9157750d04dfb2863bc5822b908336e663b141b1 (patch)
tree3ec8ac81aef2ea1e67db38d6c2b013ee8dddab33 /discord/pylon.lua
parent87ed4adab569504e4ce053f8288a84404f63c8dc (diff)
Use shortname config rather than hard-coding [x] and so on.
Pylons may also make their own choce in how they format the short-name when sending out (or do it differently altogether), rather than it being baked-in by the receiving pylon.
Diffstat (limited to 'discord/pylon.lua')
-rw-r--r--discord/pylon.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/discord/pylon.lua b/discord/pylon.lua
index 15a1418..64fe921 100644
--- a/discord/pylon.lua
+++ b/discord/pylon.lua
@@ -53,7 +53,7 @@ function Discord._req(self, url, payload)
if wait>5 then self.log:warn("isn't",wait,"a little long to be waiting?") end
cqueues.sleep(wait)
end
-
+
if #bod == 0 then return nil end
local val, _, err = json.decode(bod)
if err then error(err) else return val end
@@ -132,9 +132,10 @@ 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(self, d.channel_id), {
+ self.wilson:deliver({
+ source_channel = Channel(self, d.channel_id),
body = d.content,
- sender = '[d]' .. d.author.username,
+ sender = d.author.username,
})
end
end
@@ -145,7 +146,7 @@ function Discord.sending(self)
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, {
- username = message.sender,
+ username = message.sender.." ["..message.source_channel.pylon.shortname.."]",
content = message.body,
})
end