Fix CCs with no args (#2114)

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
Toby Harradine
2018-09-10 00:35:53 +10:00
committed by GitHub
parent af220e497f
commit 27b0d606c8

View File

@@ -349,6 +349,7 @@ class CustomCommands:
param = self.transform_parameter(result, ctx.message) param = self.transform_parameter(result, ctx.message)
raw_response = raw_response.replace("{" + result + "}", param) raw_response = raw_response.replace("{" + result + "}", param)
results = re.findall(r"\{((\d+)[^\.}]*(\.[^:}]+)?[^}]*)\}", raw_response) results = re.findall(r"\{((\d+)[^\.}]*(\.[^:}]+)?[^}]*)\}", raw_response)
if results:
low = min(int(result[1]) for result in results) low = min(int(result[1]) for result in results)
for result in results: for result in results:
index = int(result[1]) - low index = int(result[1]) - low