From 6de32954b4dce983102baf47b08cbf793dee598b Mon Sep 17 00:00:00 2001 From: mio Date: Mon, 25 Apr 2022 21:35:14 +0000 Subject: [PATCH] Bump release version to 1.2 - Bump rockspecs to 1.2 - (hellobot) Add explanation for scheduled tasks --- README.md | 1 + docs/README.md | 4 +++- examples/hellobot/hellobot.servers.lua | 19 +++++++++++++++++++ ...tte-1.1-1.rockspec => itte-1.2-1.rockspec} | 4 ++-- 4 files changed, 25 insertions(+), 3 deletions(-) rename rockspecs/{itte-1.1-1.rockspec => itte-1.2-1.rockspec} (95%) diff --git a/README.md b/README.md index 89ce433..1bbe961 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Currently supported: - Joining multiple servers - Ad-hoc connecting to servers and joining channels - Config reload +- Scheduled tasks ## Installation diff --git a/docs/README.md b/docs/README.md index b8c9d47..b68d0f3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -113,12 +113,14 @@ Codes accessible by all users: - `ping`: send a pong message. + ## Examples The `examples/` directory has a few demo bots to show how to use the module. - *hellobot*: a "hello world" example that greets users in several different - languages when they type `!hello`. + languages when they type `!hello`. The source files include more information + about available configuration settings. - *ramenkan*: a bot that serves ramen. It has some custom config settings and scheduled tasks. diff --git a/examples/hellobot/hellobot.servers.lua b/examples/hellobot/hellobot.servers.lua index 4ab8182..8c341a5 100644 --- a/examples/hellobot/hellobot.servers.lua +++ b/examples/hellobot/hellobot.servers.lua @@ -29,6 +29,25 @@ itte_servers = { auth_user = "botuser", auth_pass = nil, code_prefix = "!", + -- Credentials for people who can access the admin commands. + -- This is specific to the bot and not tied to IRC usernames. admins = { demouser = "password", }, + -- Scheduled tasks. + tasks = { + task1 = { + -- Interval at which tasks are performed. Options: + -- Every 5, 10, 15, 20 or 30 minutes — e.g. "5m" for 5 minutes + -- hourly, daily, weekly, monthly + interval = "daily", + -- If the interval is set to hourly, daily, weekly or monthly, + -- specify the time here. If no time is specified, the task will occur + -- at 00:00. + time = "12:00", + -- The name of the handler to run for the task. + handler = "hello", + -- The channels or users where the task handler will send messages. + recipients = { "#channel1" }, + }, + }, }, } diff --git a/rockspecs/itte-1.1-1.rockspec b/rockspecs/itte-1.2-1.rockspec similarity index 95% rename from rockspecs/itte-1.1-1.rockspec rename to rockspecs/itte-1.2-1.rockspec index bf0f2fc..67ee65c 100644 --- a/rockspecs/itte-1.1-1.rockspec +++ b/rockspecs/itte-1.2-1.rockspec @@ -1,8 +1,8 @@ package = "itte" -version = "1.1-1" +version = "1.2-1" source = { url = "git+https://git.tilde.town/mio/itte", - tag = "1.1", + tag = "1.2", } description = { summary = "Mini IRC bot module in lua",