save christmas

This commit is contained in:
Cadey Ratio 2019-12-26 06:47:49 +00:00
parent 1f74e4e3d2
commit d7b47df5c4
6 changed files with 26 additions and 9 deletions

View File

@ -2,4 +2,10 @@ FROM xena/lua:5.3
WORKDIR /ketracel
COPY . .
ENV PATH $PATH:/root/.luarocks/bin
RUN ./scripts/build_docker.sh
RUN apk --no-cache add ngircd \
&& luarocks-5.3 install --local moonscript \
&& luarocks-5.3 install --local busted \
&& luarocks-5.3 install --local --only-deps ./ketracel*.rockspec \
&& ./scripts/test.sh \
&& ./scripts/build_docker.sh \
&& apk del ngircd

View File

@ -2,4 +2,4 @@
export LUA_PATH='/root/.luarocks/share/lua/5.3/?.lua;/root/.luarocks/share/lua/5.3/?/init.lua'
export LUA_CPATH='/root/.luarocks/lib/lua/5.3/?.so'
lua5.3 -l ketracel
lua5.3 -l ketracel.main

View File

@ -17,15 +17,17 @@ dependencies = {
"irc-engine",
"luasocket",
"ln",
"uuid",
}
build = {
type = "builtin",
modules = {
["ketracel.bot.commands"] = "src/ketracel/bot/commands.lua",
["ketracel.bot.ketracel"] = "src/ketracel/bot/ketracel.lua",
["ketracel.bots.commands"] = "src/ketracel/bots/commands.lua",
["ketracel.bots.ketracel"] = "src/ketracel/bots/ketracel.lua",
["ketracel.main"] = "src/ketracel/main.lua",
["ketracel.server"] = "src/ketracel/server.lua",
["irce.modules.ngircd"] = "src/irce/modules/ngircd/init.lua",
["irce.modules.ngircd.channel"] = "src/irce/modules/ngircd/channel.lua",
["irce.modules.ngircd.modes"] = "src/irce/modules/ngircd/modes.lua",
["irce.modules.oper"] = "src/irce/modules/oper.lua",
},

View File

@ -2,4 +2,4 @@
tup
cd src
godotenv -f ../.env lua5.3 -l set_paths ketracel.lua
godotenv -f ../.env lua5.3 -l set_paths ./ketracel/main.lua

View File

@ -48,6 +48,16 @@ modeconv = require "irce.modules.ngircd.modes"
:nick, :user, :host, modes: string.sub(modes, 2), :real, metadata: {}
string.format ":%s NICK %s 1 %s %s 1 %s :%s", state.sname, nick, user, host, modes, real
["CHANINFO"]: (state, channame) =>
if state.channels[channame] == nil
state.channels[channame] =
name: channame
mode: "tn"
topic: ""
members: {}
string.format ":%s CHANINFO %s +tn", state.sname, channame
["NJOIN"]: (state, channame, who, prefix) =>
if state.channels[channame] == nil
state.channels[channame] =
@ -191,7 +201,7 @@ modeconv = require "irce.modules.ngircd.modes"
pfxarr = {}
for i = 1, #prefix
pfxarr[i] = modes.convert string.sub prefix, i, i
pfxarr[i] = modeconv.convert string.sub prefix, i, i
state.channels[chan].members[nick] = pfxarr

View File

@ -16,12 +16,11 @@ class Ketracel
@router = router
burst: =>
@irc\NICK "Ketracel", "white", "the.dominion", "+io", "Ketracel White"
@irc\NJOIN "#ketracel", "Ketracel", "&@"
@irc\NICK @name, "white", "the.dominion", "+io", "Ketracel White"
njoin: (chan) =>
@irc\NJOIN chan, "Ketracel"
die: (sender, target, verb, args) =>
@irc\handle "DIE", string.format("%s asked me to die in %s", sender, target)