summaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
Diffstat (limited to 'discord')
-rw-r--r--discord/pylon.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/discord/pylon.lua b/discord/pylon.lua
index 180ec27..0e8c470 100644
--- a/discord/pylon.lua
+++ b/discord/pylon.lua
@@ -50,7 +50,7 @@ function Discord._connect(self)
local me = self:_req"users/@me"
self.bot_id = me.id
- self.log('logged in as ',me)
+ self.log('logged in as ',me.username)
for busname, bus in pairs(self.wilson.busses) do
for _, channel in ipairs(bus) do
@@ -65,15 +65,14 @@ function Discord.add_channel(self, channel)
local webhooks = self:_req("channels/"..channel.descriptor.."/webhooks")
for _,wh in pairs(webhooks) do
if wh.application_id == self.bot_id then
- -- self.log.debug("Found existing webhook for channel",channel.descriptor)
+ self.log("Found existing webhook for channel",channel.descriptor)
self.channel_to_webhook[channel.descriptor] = wh
return
end
end
- print("Making webhook for channel "..channel.descriptor)
+ self.log("Making webhook for channel",channel.descriptor)
local wh = self:_req_post("channels/"..channel.descriptor.."/webhooks", {
name=self.name:gsub("discord",""):gsub("clyde","").." wilson hook" })
- pprint(wh)
self.channel_to_webhook[channel.descriptor] = wh
end
@@ -92,9 +91,9 @@ end
function Discord.recving(self)
for packet in self.ws:each() do
local event = json.decode(packet)
- print(event.s, event.op, event.t)
+ self.log:debug(event.s, event.op, event.t)
if event.op ~= opcodes.dispatch then
- pprint(event.d)
+ self.log:debug(event.d)
end
if event.s then self.sequence_number = event.s end
@@ -117,7 +116,7 @@ function Discord.handle_dispatch(self, event)
sender = '[d]' .. d.author.username,
})
elseif event.t == 'READY' then
- pprint(event.d)
+ self.log:debug(event.d)
end
end