mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 17:32:31 -05:00
Fix CCs with no args (#2114)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
This commit is contained in:
@@ -349,11 +349,12 @@ 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)
|
||||||
low = min(int(result[1]) for result in results)
|
if results:
|
||||||
for result in results:
|
low = min(int(result[1]) for result in results)
|
||||||
index = int(result[1]) - low
|
for result in results:
|
||||||
arg = self.transform_arg(result[0], result[2], cc_args[index])
|
index = int(result[1]) - low
|
||||||
raw_response = raw_response.replace("{" + result[0] + "}", arg)
|
arg = self.transform_arg(result[0], result[2], cc_args[index])
|
||||||
|
raw_response = raw_response.replace("{" + result[0] + "}", arg)
|
||||||
await ctx.send(raw_response)
|
await ctx.send(raw_response)
|
||||||
|
|
||||||
def prepare_args(self, raw_response) -> Mapping[str, Parameter]:
|
def prepare_args(self, raw_response) -> Mapping[str, Parameter]:
|
||||||
|
|||||||
Reference in New Issue
Block a user