]> jfr.im git - irc/quakenet/newserv.git/blob - lua/lib/quakenet/achievements.lua
04f7babee37dc0946a5568624db3ac4365713ab7
[irc/quakenet/newserv.git] / lua / lib / quakenet / achievements.lua
1 require "lib/class"
2
3 Achievements = class(function(obj, bot_id, types)
4 obj.bot_id = bot_id
5 obj.types = types
6 end)
7
8 function Achievements:send(nick, type, ...)
9 local extra = ...
10 if not extra then
11 extra = 0
12 end
13
14 local ntype = self.types[type]
15 if ntype then
16 type = ntype
17 end
18
19 local user_numeric = irc_numerictobase64(nick.numeric)
20 irc_privmsg("C", "EXTACH " .. user_numeric .. " " .. self.bot_id .. " " .. type .. " " .. extra)
21 end