From 44e56e08848b3d65646e37b75b447fe356642b47 Mon Sep 17 00:00:00 2001 From: mio Date: Thu, 28 Apr 2022 03:27:56 +0000 Subject: [PATCH] (hellobot) Minor adjustment for scheduled task --- examples/hellobot/hellobot.config.lua | 7 +++++++ examples/hellobot/hellobot.servers.lua | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/hellobot/hellobot.config.lua b/examples/hellobot/hellobot.config.lua index 57fa8bf..9fbf5a1 100644 --- a/examples/hellobot/hellobot.config.lua +++ b/examples/hellobot/hellobot.config.lua @@ -77,5 +77,12 @@ function h.hello(cxt, msg) end +-- This is a task handler for a task named "hello" in the sample config, and is +-- an alias to the hello() function above. +function h.th_hello(cxt, msg) + h.hello(cxt, msg) +end + + -- Hook up the handlers. itte_handlers = h diff --git a/examples/hellobot/hellobot.servers.lua b/examples/hellobot/hellobot.servers.lua index 8c341a5..1f74454 100644 --- a/examples/hellobot/hellobot.servers.lua +++ b/examples/hellobot/hellobot.servers.lua @@ -34,7 +34,7 @@ itte_servers = { admins = { demouser = "password", }, -- Scheduled tasks. tasks = { - task1 = { + hello = { -- 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 @@ -44,7 +44,7 @@ itte_servers = { -- at 00:00. time = "12:00", -- The name of the handler to run for the task. - handler = "hello", + handler = "th_hello", -- The channels or users where the task handler will send messages. recipients = { "#channel1" }, },