Project

ellen-cron

0.01
No commit activity in last 3 years
No release in over 3 years
Mount cron system to Ellen to schedule messages on a specific time.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0

Runtime

>= 0
>= 0.2.0
 Project Readme

Ruboty::Cron

Mount cron system to Ruboty to schedule messages on a specific time.

Usage

You can use any Chrono compatible cron syntax to schedule messages.

@ruboty add job "<cron syntax>" <message> - Add a new cron job
@ruboty delete job <id>                   - Delete a cron job
@ruboty suspend job <id>                  - Suspend a cron job
@ruboty resume job <id>                   - Resume a cron job
@ruboty list jobs                         - List all cron jobs

The scheduled message will be delivered to your bot itself (instead of posting to somewhere by the bot directly) on the time. If the message contains any valid command, your bot will try to respond to it.

Example

$ bundle exec ruboty
Type `exit` or `quit` to end the session.
> @ruboty add job "* * * * *" @ruboty ping
Job 3117 created
pong
pong
pong
pong
pong
> @ruboty list jobs
 3117: "* * * * *" @ruboty ping
> @ruboty delete job 3117
Deleted
>

Tips

If you want to schedule Ruboty to say something, ruboty-echo may help you.

> @ruboty add job "0 8 * * 1-5" @ruboty echo It's Time for School!

Note that you need to include @ruboty before the command name echo, because ruboty-echo responds only for any mention to the bot itself. Otherwise your bot will ignore the message as an invalid echo command.