From 146d9b67a95ddd9148e890a0aa11003c15268b13 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 28 May 2021 09:45:18 -0700 Subject: [PATCH] Add optional #channel.interpolate_factoids registry setting --- PBot/Factoids.pm | 3 +++ doc/Registry.md | 1 + 2 files changed, 4 insertions(+) diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index ea937d44..6d47bdc5 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -748,6 +748,9 @@ sub expand_factoid_vars { my $interpolate = $self->{factoids}->get_data($context->{channel}, $context->{keyword}, 'interpolate'); return $action if defined $interpolate and $interpolate == 0; + $interpolate = $self->{pbot}->{registry}->get_value($context->{channel}, 'interpolate_factoids'); + return $action if defined $interpolate and $interpolate == 0; + $action = $self->expand_factoid_selectors($context, $action, %opts); my $depth = 0; diff --git a/doc/Registry.md b/doc/Registry.md index 9b60da5e..a11f420e 100644 --- a/doc/Registry.md +++ b/doc/Registry.md @@ -248,3 +248,4 @@ Name | Description [channel].strictnamespace | When enabled, factoids belonging to other channels will not show up in this channel unless specifically invoked. [channel].trigger | Overrides the bot trigger for this channel. [channel].typosub_ignore_commands | Do not apply `s//` substitution to bot commands. +[channel].interpolate_factoids | If this key exists and is set to `0` then factoids containing `$variables` will not have the variables expanded and interpolated.