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

Factoids: add get_meta()

This commit is contained in:
Pragmatic Software 2020-02-10 01:06:38 -08:00
parent 4327f13bef
commit 224ace9e80

View File

@ -71,6 +71,15 @@ sub save_factoids {
$self->export_factoids; $self->export_factoids;
} }
sub get_meta {
my ($self, $channel, $trigger, $key) = @_;
$channel = lc $channel;
$trigger = lc $trigger;
my ($chan, $trig) = $self->find_factoid($channel, $trigger, exact_channel => 1);
return undef if not defined $chan;
return $self->{factoids}->{hash}->{$chan}->{$trig}->{$key};
}
sub add_factoid { sub add_factoid {
my $self = shift; my $self = shift;
my ($type, $channel, $owner, $trigger, $action, $dont_save) = @_; my ($type, $channel, $owner, $trigger, $action, $dont_save) = @_;