zorael / kameloso

IRC bot with Twitch support
Boost Software License 1.0
9 stars 3 forks source link

timers-ng #126

Closed zorael closed 2 years ago

zorael commented 2 years ago

This breaks out Twitch timers into its own Timer plugin, since the functionality isn't really Twitch-specific.

In addition, timers are improved to now be able to serve more than one line. In what way they're yielded is decided at timer creation; random for a random line, sequential for an ordered list. This likely means you will only ever want one timer (with several lines), but there's nothing stopping you from having a hundred with a hundred lines each.

Creating them is necessarily complex now, so it's done in two steps.

!timer new [name] [type] [condition] [message count threshold] [time threshold] [message count stagger] [time stagger]
!timer add [name] This is the first line
!timer add [name] This is the second one
!timer add [name] and so forth

Like before, simple replacements for $bot, $channel etc is done. Notably (and different from Oneliners) $nickname doesn't work, since there's no nickname instigating the timer firing.

Previous timers will need to be redefined.