mirror of
https://github.com/pragma-/pbot.git
synced 2025-10-15 15:37:22 +02:00
Commands: add set_meta function
This commit is contained in:
parent
164e4d94ae
commit
0af8fc4c5c
@ -131,6 +131,15 @@ sub interpreter {
|
|||||||
return undef;
|
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 {
|
sub get_meta {
|
||||||
my ($self, $command, $key) = @_;
|
my ($self, $command, $key) = @_;
|
||||||
$command = lc $command;
|
$command = lc $command;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user