summaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
Diffstat (limited to 'discord')
-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