3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Commands: add set_meta function

This commit is contained in:
Pragmatic Software 2020-01-31 19:35:22 -08:00
parent 164e4d94ae
commit 0af8fc4c5c

View File

@ -131,6 +131,15 @@ sub interpreter {
return undef;
}
sub set_meta {
my ($self, $command, $key, $value, $save) = @_;
$command = lc $command;
return undef if not exists $self->{metadata}->{hash}->{$command};
$self->{metadata}->{hash}->{$command}->{$key} = $value;
$self->save_metadata if $save;
return 1;
}
sub get_meta {
my ($self, $command, $key) = @_;
$command = lc $command;