From 81469bbb1745a835676c3664e75a4a951223da9d Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 30 Jul 2024 19:25:59 -0400 Subject: * fixed a crash when unloading a lua script * added event types, foreground and background color for watchlists * added a url_encode function to lua to encode urls. Underneath, it just calls the standard library function from golang * updated the README * the urban plugin now can take in the number of entries to return * reverted a bug where setting the http proxy for the lua http module was not working * fixed the url for the ip script so it is actually working. the current provider does not support ipv6 though --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 467a5b7..58713b1 100644 --- a/README.md +++ b/README.md @@ -272,6 +272,9 @@ Watchlists allow you to specify a list of channels to watch. The watched values watchList = ["#securityfeeds"] watchFiles = ["/watchfiles/voidbox.list"] alertChannel = "#milla_alerts" +eventTypes = ["PRIVMSG"] +fgColor = 0 +bgColor = 28 ``` ### Example Config File @@ -706,6 +709,10 @@ milla.query_db(query) milla.register_cmd(script_path, cmd_name, function_name) ``` +```lua +milla.url_encode(str) +``` + Using `register_cmd` we can register a command that will be available to run like the built-in and customs commands.
Here's an example of how to use it:
@@ -725,7 +732,7 @@ local http = require("http") -- should only return one string value function milla_get_ip(arg) local ip = arg - local response, err = http.request("GET", "http://ip-api.com/json?" .. ip) + local response, err = http.request("GET", "http://ip-api.com/json/" .. ip) if err ~= nil then print(err) end local json_response, err = json.decode(response.body) @@ -746,7 +753,7 @@ milla.register_cmd("/plugins/ip.lua", "ip", "milla_get_ip") This will allow us to do:
``` -/terra: /ip 1.1.1.1 +terra: /ip 1.1.1.1 ``` The example rss plugin, accepts a yaml file as input, reeds the provided rss feeds once, extracts the title, author name and link to the resource, sends the feed over to the `#rssfeed` irc channel and exits.
-- cgit v1.2.3