diff --git a/PBot/Plugins/Spinach.pm b/PBot/Plugins/Spinach.pm index 4e04d67d..9ed6d29e 100644 --- a/PBot/Plugins/Spinach.pm +++ b/PBot/Plugins/Spinach.pm @@ -233,7 +233,7 @@ sub spinach_cmd { my ($self, $from, $nick, $user, $host, $arguments) = @_; $arguments =~ s/^\s+|\s+$//g; - my $usage = "Usage: spinach join|exit|ready|unready|choose|lie|reroll|skip|score|show|categories|filter|kick|abort; for more information about a command: spinach help "; + my $usage = "Usage: spinach join|exit|ready|unready|choose|lie|reroll|skip|score|show|categories|filter|set|unset|kick|abort; for more information about a command: spinach help "; my $command; ($command, $arguments) = split / /, $arguments, 2; @@ -312,6 +312,14 @@ sub spinach_cmd { return "Help is coming soon."; } + when ('set') { + return "Help is coming soon."; + } + + when ('unset') { + return "Help is coming soon."; + } + default { if (length $arguments) { return "Spinach has no such command '$arguments'. I can't help you with that."; @@ -862,6 +870,24 @@ sub spinach_cmd { } } + when ('set') { + my ($index, $key, $value) = split /\s+/, $arguments; + + if (not defined $index) { + return "Usage: spinach set [key [value]]"; + } + return $self->{metadata}->set($index, $key, $value); + } + + when ('unset') { + my ($index, $key) = split /\s+/, $arguments; + + if (not defined $index or not defined $key) { + return "Usage: spinach unset "; + } + return $self->{metadata}->unset($index, $key); + } + default { return $usage; }