diff --git a/examples/gordon/commands/borgar.lua b/examples/gordon/commands/burger.lua similarity index 83% rename from examples/gordon/commands/borgar.lua rename to examples/gordon/commands/burger.lua index a81d851..73cc545 100644 --- a/examples/gordon/commands/borgar.lua +++ b/examples/gordon/commands/burger.lua @@ -1,5 +1,5 @@ grammar = { - meatset = { + meat_set = { "360 Burger with a large patty, tomatos, cheddar and onions in a Dijon mustard sauce", "Bada Boom cheeseburger with a juicy steak, cheddar, onions and tomatos", "Bag Baguette featuring two patties and Emmental cheese in a long crusty baguette", @@ -23,14 +23,14 @@ grammar = { "Super Bacon burger", "Vast Veggie burger with a veggie patty and Emmental cheese", }, - veggieset = { + veggie_set = { "Veggie Thing overflowing with a spicy sauce", }, - meatside = { + meat_side = { "chicken fries", "house fries with a mayonnaise dip", }, - veggieside = { + veggie_side = { "chips deluged with potato sauce", "onion rings", }, @@ -40,11 +40,11 @@ grammar = { "set of 3 petit pancakes topped with hazelnut cocoa or strawberry cream", }, origin = { - "Here, have a #meatset# !", - "Here, have a #veggieset# !", - "Here, have a #meatset# served with a side of #meatside# !", - "Here, have a #meatset# served with a side of #veggieside# !", - "Here, have a #veggieset# served with a side of #veggieside# !", - "Here, have a #meatset# served with a #dessert# !", + "Here, have a #meat_set#!", + "Here, have a #veggie_set#!", + "Here, have a #meat_set# served with a side of #meat_side#!", + "Here, have a #meat_set# served with a side of #veggie_side#!", + "Here, have a #veggie_set# served with a side of #veggie_side#!", + "Here, have a #meat_set# served with a #dessert#!", } } diff --git a/examples/gordon/commands/cofe.lua b/examples/gordon/commands/coffee.lua similarity index 100% rename from examples/gordon/commands/cofe.lua rename to examples/gordon/commands/coffee.lua diff --git a/examples/gordon/folia.lua b/examples/gordon/folia.lua index d99af35..5f4e7b7 100644 --- a/examples/gordon/folia.lua +++ b/examples/gordon/folia.lua @@ -54,7 +54,7 @@ function folia.output(key) end local output_str = util.pick(foils[key]["origin"])[1] - local pattern = "#(%w+)#" + local pattern = "#(%w+_*%-*%w+)#" util.debug("output", "level 1: " .. output_str, folia.debug) -- Check for expansion objects and replace them until none are found while string.find(output_str, pattern) ~= nil do diff --git a/examples/gordon/gordon.config.lua b/examples/gordon/gordon.config.lua index 73c1e1d..f8dc835 100644 --- a/examples/gordon/gordon.config.lua +++ b/examples/gordon/gordon.config.lua @@ -4,8 +4,9 @@ local folia = require("folia") itte_config = { debug = false, messages = { - help = "Casa's Kitchen commands: {{codes}}", - quit = "Machef under maintenance.", + help = "Don't just stand there like a big f—ing muffin! " .. + "Order something! Your Casa's Kitchen commands are: {{codes}}", + quit = "Master Chef under maintenance.", reload = "Config reloaded.", }, } @@ -18,12 +19,6 @@ folia.foils_dir = "/home/mio/bin/itte/examples/gordon/commands" local gordon = {} --- Show help message -function itte_handlers.botland(cxt, msg) - irc._h.help(cxt, msg) -end - - -- Create handlers for each foil function gordon.generate_handlers(handlers, foils_dir) local foils = folia.get_foils(foils_dir) @@ -32,6 +27,18 @@ function gordon.generate_handlers(handlers, foils_dir) irc.message(cxt, { msg.reply_to }, folia.output(key)) end end + + -- Add aliases + if folia.output("burger") ~= nil then + itte_handlers.borgar = function (cxt, msg) + irc.message(cxt, { msg.reply_to }, folia.output("burger")) + end + end + if folia.output("coffee") ~= nil then + itte_handlers.cofe = function (cxt, msg) + irc.message(cxt, { msg.reply_to }, folia.output("coffee")) + end + end end diff --git a/examples/hachi/folia.lua b/examples/hachi/folia.lua index d99af35..5f4e7b7 100644 --- a/examples/hachi/folia.lua +++ b/examples/hachi/folia.lua @@ -54,7 +54,7 @@ function folia.output(key) end local output_str = util.pick(foils[key]["origin"])[1] - local pattern = "#(%w+)#" + local pattern = "#(%w+_*%-*%w+)#" util.debug("output", "level 1: " .. output_str, folia.debug) -- Check for expansion objects and replace them until none are found while string.find(output_str, pattern) ~= nil do