Factoids: add `keep-quotes` metadata for applet commands

This commit is contained in:
Pragmatic Software 2022-06-27 19:52:38 -07:00
parent 780d41e628
commit 41b69bdfa5
5 changed files with 15 additions and 3 deletions

BIN
data/factoids.sqlite3 vendored

Binary file not shown.

View File

@ -82,7 +82,11 @@ sub launch_applet {
$args = encode('UTF-8', $args);
}
my @cmdline = ("./$applet", $self->{pbot}->{interpreter}->split_line($args));
my $strip_quotes = 1;
$strip_quotes = 0 if $self->{pbot}->{factoids}->{data}->{storage}->get_data($channel, $trigger, 'keep-quotes');
my @cmdline = ("./$applet", $self->{pbot}->{interpreter}->split_line($args, strip_quotes => $strip_quotes));
my $timeout = $self->{pbot}->{registry}->get_value('general', 'applet_timeout') // 30;

View File

@ -27,6 +27,7 @@ our %factoid_metadata = (
'enabled' => 'INTEGER',
'help' => 'TEXT',
'interpolate' => 'INTEGER',
'keep-quotes' => 'INTEGER',
'keyword_override' => 'TEXT',
'last_referenced_in' => 'TEXT',
'last_referenced_on' => 'NUMERIC',

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4545,
BUILD_DATE => "2022-06-26",
BUILD_REVISION => 4546,
BUILD_DATE => "2022-06-27",
};
sub initialize {}

View File

@ -0,0 +1,7 @@
#!/usr/bin/env perl
# Recent updates require a bot restart
#
# Added 'keep-quotes' factoid metadata.
exit 0;