~tyil/raku-irc-client-plugin-reminders

1f80a131c3a050fc0db544789fee7f03c0f2026f — Patrick Spek 5 months ago 5d172bf
Add TODOs
2 files changed, 12 insertions(+), 16 deletions(-)

M lib/IRC/Client/Plugin/Reminders.rakumod
D t/01-grammar.rakutest
M lib/IRC/Client/Plugin/Reminders.rakumod => lib/IRC/Client/Plugin/Reminders.rakumod +12 -3
@@ 23,10 23,11 @@ method reload-config (
	self.TWEAK;
}

# TODO: Set a reminder: "bot: remind me to <something> in <delay>"
multi method irc-to-me (
	$event where *.text.starts-with('remind me'),
) {
	# TODO: Allow people to set reminders for others?

	my $result = ReminderGrammar.parse(
		$event.text,
		:actions(ReminderActions),


@@ 38,12 39,20 @@ multi method irc-to-me (

	dd %reminder<delay>.Str;

	# TODO: Record the reminder entry in the database

	"Reminding you to {%reminder<subject>} on {%reminder<delay>.at}"
}

# TODO: Regularly check for reminders to post about
multi method irc-started () {
	.warning("IRC::Client::Plugin::Reminders.irc-started") with $*LOG;
	# TODO: Check for usable $*DATABASE

	# TODO: Check tables for reminders that were missed while the bot was
	# offline.

	# TODO: Check for things to remind for periodically

	.debug("IRC::Client::Plugin::Reminders.irc-started") with $*LOG;
}

=begin pod

D t/01-grammar.rakutest => t/01-grammar.rakutest +0 -13
@@ 1,13 0,0 @@
#!/usr/bin/env raku

use v6.d;

use Test;

use IRC::Client::Plugin::Reminders::Grammar;
use IRC::Client::Plugin::Reminders::Actions;

constant ReminderGrammar = IRC::Client::Plugin::Reminders::Grammar;
constant ReminderActions = IRC::Client::Plugin::Reminders::Actions;

dd ReminderGrammar.parse('Remind me to get in on the action in 1 hour', :actions(ReminderActions)).made;