diff --git a/config.template b/config.template index 9144679..05e77b9 100644 --- a/config.template +++ b/config.template @@ -287,7 +287,7 @@ message = "MeshBot says Hello! DM for more info." # enable overides the above and uses the motd as the message schedulerMotd = False # value can be min,hour,day,mon,tue,wed,thu,fri,sat,sun. -# value can also be joke (everyXmin) or weather (hour) for special scheduled messages +# value can also be joke (everyXmin) or weather (hour) or link (hour) for special auto messages # custom for module/scheduler.py custom schedule examples value = # interval to use when time is not set (e.g. every 2 days) diff --git a/modules/scheduler.py b/modules/scheduler.py index f7582a6..020f794 100644 --- a/modules/scheduler.py +++ b/modules/scheduler.py @@ -55,6 +55,10 @@ async def setup_scheduler( # Schedule to send a joke every specified interval schedule.every(int(schedulerInterval)).minutes.do(lambda: send_message(tell_joke(), schedulerChannel, 0, schedulerInterface)) logger.debug(f"System: Starting the joke scheduler to send a joke every {schedulerInterval} minutes on Device:{schedulerInterface} Channel:{schedulerChannel}") + elif 'link' in schedulerValue.lower(): + # Schedule to send a link message every specified interval + schedule.every(int(schedulerInterval)).hours.do(lambda: send_message(handle_satpass(schedulerInterface, 'link'), schedulerChannel, 0, schedulerInterface)) + logger.debug(f"System: Starting the link scheduler to send link messages every {schedulerInterval} hours on Device:{schedulerInterface} Channel:{schedulerChannel}") elif 'weather' in schedulerValue.lower(): # Schedule to send weather updates every specified interval schedule.every(int(schedulerInterval)).hours.do(lambda: send_message(handle_wxc(0, schedulerInterface, 'wx'), schedulerChannel, 0, schedulerInterface))