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

Plugins/Plang: die() with newline to prevent line number info from being added

This commit is contained in:
Pragmatic Software 2020-08-22 14:49:17 -07:00
parent f5c7ff1c9a
commit 7c5e649a87

View File

@ -168,7 +168,7 @@ sub plang_builtin_factget {
sub plang_builtin_factset {
my ($self, $plang, $context, $name, $arguments) = @_;
my ($channel, $keyword, $text) = ($arguments->[0]->[1], $arguments->[1]->[1], $arguments->[2]->[1]);
die "Factoid $channel.$keyword is locked. Cannot set." if $self->is_locked($channel, $keyword);
die "Factoid $channel.$keyword is locked. Cannot set.\n" if $self->is_locked($channel, $keyword);
$self->{pbot}->{factoids}->add_factoid('text', $channel, 'Plang', $keyword, $text);
return [['TYPE', 'String'], $text];
}
@ -176,7 +176,7 @@ sub plang_builtin_factset {
sub plang_builtin_factappend {
my ($self, $plang, $context, $name, $arguments) = @_;
my ($channel, $keyword, $text) = ($arguments->[0]->[1], $arguments->[1]->[1], $arguments->[2]->[1]);
die "Factoid $channel.$keyword is locked. Cannot append." if $self->is_locked($channel, $keyword);
die "Factoid $channel.$keyword is locked. Cannot append.\n" if $self->is_locked($channel, $keyword);
my $action = $self->{pbot}->{factoids}->get_meta($channel, $keyword, 'action');
$action = "" if not defined $action;
$action .= $text;