diff --git a/reactbot.py b/reactbot.py index c1812ee..41f7de9 100644 --- a/reactbot.py +++ b/reactbot.py @@ -111,6 +111,9 @@ class Template: def _replace_variables(tpl: str, variables: Dict[str, Any]) -> str: for match in variable_regex.finditer(tpl): val = variables[match.group(1)] + if match.start() == 0 and match.end() == len(tpl): + # Whole field is a single variable, just return the value to allow non-string types. + return val tpl = tpl[:match.start()] + val + tpl[match.end():] return tpl